-
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-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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
Variables can be marked as unused by prepending with an underscore. If at some point such a variable is used again, the compiler suggests to name the use _x
, even though every single time I have encountered this, what I wanted is to change the definition of _x
to x
.
fn main() {
let _x = 42;
let y = x;
}
Errors:
Compiling playground v0.0.1 (/playground)
error[E0465]: multiple rlib candidates for `debug_unreachable` found
|
= note: candidate #1: /playground/target/debug/deps/libdebug_unreachable-aa3385f4476cae47.rlib
= note: candidate #2: /playground/target/debug/deps/libdebug_unreachable-661505f3db863158.rlib
error[E0425]: cannot find value `x` in this scope
--> src/main.rs:3:13
|
3 | let y = x;
| ^ help: a local variable with a similar name exists: `_x`
error: aborting due to 2 previous errors
Some errors occurred: E0425, E0465.
For more information about an error, try `rustc --explain E0425`.
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
phrohdoh, estebank, bjorn3 and wesleywiser
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.