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