-
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-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
In case there is an undeclared lifetime in an ADT deriving Eq
a wrong help message is emited
#[derive(Eq, PartialEq)]
struct Test {
a: &'b str,
}
causes the following error
error[E0261]: use of undeclared lifetime name `'b`
--> src/lib.rs:3:9
|
2 | struct Test {
| - help: consider introducing lifetime `'b` here: `<'b>`
3 | a: &'b str,
| ^^ undeclared lifetime
error[E0261]: use of undeclared lifetime name `'b`
--> src/lib.rs:3:9
|
3 | a: &'b str,
| ^^ undeclared lifetime
|
help: consider introducing lifetime `'b` here
|
1 | #[derive(<'b>, PartialEq)]
| ^^^^
help: consider introducing lifetime `'b` here
|
1 | #[derive(<'b>, PartialEq)]
| ^^^^
thx, bye
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.