1
Fork 0

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:
Alan Egerton 2024-04-12 12:33:03 +01:00
parent ab71ee7a92
commit ddcfb94b84
No known key found for this signature in database
GPG key ID: 7D4C2F6C22122532
6 changed files with 22 additions and 48 deletions

View file

@ -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

View file

@ -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