Code
use std::ops::Range;
fn f(r: Range<u32>) {
let start..end = r;
}
Current output
error[E0425]: cannot find value `start` in this scope
--> src/lib.rs:4:9
|
4 | let start..end = r;
| ^^^^^ not found in this scope
error[E0425]: cannot find value `end` in this scope
--> src/lib.rs:4:16
|
4 | let start..end = r;
| ^^^ not found in this scope
Desired output
A suggestion for `let Range { start, end } = r`
Rationale and extra context
I had a Range and attempted to destructure it using a..b as if it were a shorthand for the struct pattern, forgetting about ranges being special patterns already
Other cases
Rust Version
Anything else?
Not sure how common of a mistake this is to make
Code
Current output
Desired output
Rationale and extra context
I had a
Rangeand attempted to destructure it usinga..bas if it were a shorthand for the struct pattern, forgetting about ranges being special patterns alreadyOther cases
Rust Version
Anything else?
Not sure how common of a mistake this is to make