]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs
Rollup merge of #93813 - xldenis:public-mir-passes, r=wesleywiser
[rust.git] / src / test / ui / rfc-2093-infer-outlives / dont-infer-static.rs
1 /*
2  * We don't infer `T: 'static` outlives relationships by default.
3  * Instead an additional feature gate `infer_static_outlives_requirements`
4  * is required.
5  */
6
7 struct Foo<U> {
8     bar: Bar<U> //~ ERROR the parameter type `U` may not live long enough [E0310]
9 }
10 struct Bar<T: 'static> {
11     x: T,
12 }
13
14 fn main() {}