-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyE-easyCall 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.E-mentorCall 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.
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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyE-easyCall 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.E-mentorCall 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.