Closed
Description
openedon Mar 20, 2017
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsArea: Name resolutionArea: Name resolutionCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.