Closed
Description
Code: https://is.gd/6L8tEl
fn foo<'a: 'static>() {}
Output:
rustc 1.17.0-nightly (b1e31766d 2017-03-03)
error[E0261]: use of undeclared lifetime name `'static`
--> <anon>:1:12
|
1 | fn foo<'a: 'static>() {}
| ^^^^^^^ undeclared lifetime
Expectation:
<'a: 'static>
is unnecessary (you can just use 'static
in place of 'a
), but maybe we should accept it? At any rate, the error message is misleading - 'static
is the one globally declared lifetime. If we want to reject this code, the error message should not imply 'static
is undefined, but rather that you just don't need the 'a
lifetime.