2018-07-26 20:32:01 -04:00
|
|
|
/*
|
2022-06-08 21:07:46 +09:00
|
|
|
* We don't infer `T: 'static` outlives relationships.
|
2018-07-26 20:32:01 -04:00
|
|
|
*/
|
|
|
|
|
2018-07-26 20:25:27 -04:00
|
|
|
struct Foo<U> {
|
2018-12-25 08:56:47 -07:00
|
|
|
bar: Bar<U> //~ ERROR the parameter type `U` may not live long enough [E0310]
|
2018-07-26 20:25:27 -04:00
|
|
|
}
|
|
|
|
struct Bar<T: 'static> {
|
|
|
|
x: T,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|