diff options
Diffstat (limited to 'tests/ui/static/static-lifetime-bound.rs')
-rw-r--r-- | tests/ui/static/static-lifetime-bound.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/static/static-lifetime-bound.rs b/tests/ui/static/static-lifetime-bound.rs new file mode 100644 index 000000000..b5da91ec3 --- /dev/null +++ b/tests/ui/static/static-lifetime-bound.rs @@ -0,0 +1,6 @@ +fn f<'a: 'static>(_: &'a i32) {} //~WARN unnecessary lifetime parameter `'a` + +fn main() { + let x = 0; + f(&x); //~ERROR does not live long enough +} |