-
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 lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.WG-diagnosticsWorking group: DiagnosticsWorking group: Diagnostics
Description
The following code:
struct Foo {
x: &'a u8,
}
Generates this error:
error[E0261]: use of undeclared lifetime name `'a`
--> src/main.rs:2:9
|
2 | x: &'a u8,
| ^^ undeclared lifetime
error: aborting due to previous error
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
It'd be nice to provide a suggestion to add a lifetime parameter to the struct definition.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.WG-diagnosticsWorking group: DiagnosticsWorking group: Diagnostics