Closed
Description
The compiler suggests replacing rest @ ..
with _rest
, when in fact it should suggest _rest @ ..
:
fn main() {
let [rest @ ..] = [1, 2, 3];
}
Errors:
Compiling playground v0.0.1 (/playground)
warning: unused variable: `rest`
--> src/main.rs:2:10
|
2 | let [rest @ ..] = [1, 2, 3];
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_rest`
|
= note: `#[warn(unused_variables)]` on by default
warning: 1 warning emitted
Finished dev [unoptimized + debuginfo] target(s) in 0.73s
Running `target/debug/playground`
The span should point to just rest
.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Suggestions generated by the compiler applied by `cargo fix`Diagnostics: A structured suggestion resulting in incorrect code.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.