-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingD-imprecise-spansDiagnostics: spans don't point to exactly the erroneous codeDiagnostics: spans don't point to exactly the erroneous codeD-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
The help text emitted for the following suggests code that is invalid.
fn main() {
let ref mut x @ v;
*x = 1;
}
error[E0381]: used binding `x` isn't initialized
--> src/main.rs:3:5
|
2 | let ref mut x @ v;
| --------- binding declared here but left uninitialized
3 | *x = 1;
| ^^^^^^ `x` used here but it isn't initialized
|
help: consider assigning a value
|
2 | let ref mut x = &mut 42 @ v;
| +++++++++
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingD-imprecise-spansDiagnostics: spans don't point to exactly the erroneous codeDiagnostics: spans don't point to exactly the erroneous codeD-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.