diff options
Diffstat (limited to 'tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.rs')
-rw-r--r-- | tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.rs new file mode 100644 index 000000000..d3940b13b --- /dev/null +++ b/tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.rs @@ -0,0 +1,12 @@ +/* + * We don't infer `T: 'static` outlives relationships. + */ + +struct Foo<U> { + bar: Bar<U> //~ ERROR the parameter type `U` may not live long enough [E0310] +} +struct Bar<T: 'static> { + x: T, +} + +fn main() {} |