rust/tests/ui/rfc-2093-infer-outlives/dont-infer-static.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
214 B
Rust
Raw Normal View History

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