]>
Commit | Line | Data |
---|---|---|
6a06907d XL |
1 | error: irrefutable `if let` pattern |
2 | --> $DIR/deny-irrefutable-let-patterns.rs:7:5 | |
0731742a | 3 | | |
532ac7d7 | 4 | LL | if let _ = 5 {} |
0731742a XL |
5 | | ^^^^^^^^^^^^^^^ |
6 | | | |
74b04a01 | 7 | note: the lint level is defined here |
6a06907d | 8 | --> $DIR/deny-irrefutable-let-patterns.rs:4:9 |
0731742a XL |
9 | | |
10 | LL | #![deny(irrefutable_let_patterns)] | |
11 | | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
6a06907d XL |
12 | = note: this pattern will always match, so the `if let` is useless |
13 | = help: consider replacing the `if let` with a `let` | |
0731742a | 14 | |
6a06907d XL |
15 | error: irrefutable `while let` pattern |
16 | --> $DIR/deny-irrefutable-let-patterns.rs:9:5 | |
0731742a | 17 | | |
532ac7d7 | 18 | LL | / while let _ = 5 { |
0731742a XL |
19 | LL | | break; |
20 | LL | | } | |
21 | | |_____^ | |
6a06907d XL |
22 | | |
23 | = note: this pattern will always match, so the loop will never exit | |
24 | = help: consider instead using a `loop { ... }` with a `let` inside it | |
25 | ||
26 | error: irrefutable `if let` guard pattern | |
27 | --> $DIR/deny-irrefutable-let-patterns.rs:14:18 | |
28 | | | |
29 | LL | _ if let _ = 2 => {} | |
30 | | ^ | |
31 | | | |
32 | = note: this pattern will always match, so the guard is useless | |
33 | = help: consider removing the guard and adding a `let` inside the match arm | |
0731742a | 34 | |
6a06907d | 35 | error: aborting due to 3 previous errors |
0731742a | 36 |