Suppress erroneous suggestion
The suggestion to use `let else` with an uninitialized refutable `let` statement was erroneous: `let else` cannot be used with deferred initialization.
This commit is contained in:
parent
ab71ee7a92
commit
ddcfb94b84
6 changed files with 22 additions and 48 deletions
|
@ -46,10 +46,6 @@ LL | mac!(0);
|
|||
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
|
||||
= note: the matched value is of type `i32`
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: you might want to use `if let` to ignore the variant that isn't matched
|
||||
|
|
||||
LL | if let ...$e; { todo!() }
|
||||
| ++ +++++++++++
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
@ -67,10 +67,6 @@ LL | mac!(0);
|
|||
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
|
||||
= note: the matched value is of type `i32`
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: you might want to use `if let` to ignore the variant that isn't matched
|
||||
|
|
||||
LL | if let $e...; { todo!() }
|
||||
| ++ +++++++++++
|
||||
|
||||
error[E0005]: refutable pattern in local binding
|
||||
--> $DIR/half-open-range-pats-inclusive-no-end.rs:20:17
|
||||
|
@ -85,10 +81,6 @@ LL | mac!(0);
|
|||
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
|
||||
= note: the matched value is of type `i32`
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: you might want to use `if let` to ignore the variant that isn't matched
|
||||
|
|
||||
LL | if let $e..=; { todo!() }
|
||||
| ++ +++++++++++
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue