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