Files
rust/tests/ui/binding/irrefutable-in-let-chains.stderr
T
Hegui Dai 4f31ff893d Not linting irrefutable_let_patterns on let chains
inline rest of the check
try fix ci errors
inline in check_let
2026-02-19 22:27:26 +08:00

58 lines
2.0 KiB
Plaintext

warning: irrefutable `if let` pattern
--> $DIR/irrefutable-in-let-chains.rs:13:8
|
LL | if let first = &opt {}
| ^^^^^^^^^^^^^^^^
|
= note: this pattern will always match, so the `if let` is useless
= help: consider replacing the `if let` with a `let`
= note: `#[warn(irrefutable_let_patterns)]` on by default
warning: irrefutable `if let` pattern
--> $DIR/irrefutable-in-let-chains.rs:30:8
|
LL | if let Range { start: local_start, end: _ } = (None..Some(1)) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this pattern will always match, so the `if let` is useless
= help: consider replacing the `if let` with a `let`
warning: irrefutable `if let` pattern
--> $DIR/irrefutable-in-let-chains.rs:37:8
|
LL | if let (a, b, c) = (Some(1), Some(1), Some(1)) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this pattern will always match, so the `if let` is useless
= help: consider replacing the `if let` with a `let`
warning: irrefutable `if let` pattern
--> $DIR/irrefutable-in-let-chains.rs:49:15
|
LL | } else if let x = opt.clone().map(|_| 1) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this pattern will always match, so the `if let` is useless
= help: consider replacing the `if let` with a `let`
warning: irrefutable `if let` guard pattern
--> $DIR/irrefutable-in-let-chains.rs:70:28
|
LL | Some(ref first) if let second = first => {}
| ^^^^^^^^^^^^^^^^^^
|
= note: this pattern will always match, so the guard is useless
= help: consider removing the guard and adding a `let` inside the match arm
warning: irrefutable `while let` pattern
--> $DIR/irrefutable-in-let-chains.rs:99:11
|
LL | while let first = &opt {}
| ^^^^^^^^^^^^^^^^
|
= note: this pattern will always match, so the loop will never exit
= help: consider instead using a `loop { ... }` with a `let` inside it
warning: 6 warnings emitted