forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle irrufutable or unreachable let-else
- Loading branch information
1 parent
dc028f6
commit df9a2e0
Showing
3 changed files
with
41 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 18 additions & 12 deletions
30
src/test/ui/pattern/usefulness/top-level-alternation.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,74 @@ | ||
error: unreachable pattern | ||
--> $DIR/top-level-alternation.rs:4:23 | ||
--> $DIR/top-level-alternation.rs:6:23 | ||
| | ||
LL | while let 0..=2 | 1 = 0 {} | ||
| ^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/top-level-alternation.rs:1:9 | ||
--> $DIR/top-level-alternation.rs:3:9 | ||
| | ||
LL | #![deny(unreachable_patterns)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: unreachable pattern | ||
--> $DIR/top-level-alternation.rs:5:20 | ||
--> $DIR/top-level-alternation.rs:7:20 | ||
| | ||
LL | if let 0..=2 | 1 = 0 {} | ||
| ^ | ||
|
||
error: unreachable pattern | ||
--> $DIR/top-level-alternation.rs:9:15 | ||
--> $DIR/top-level-alternation.rs:11:15 | ||
| | ||
LL | | 0 => {} | ||
| ^ | ||
|
||
error: unreachable pattern | ||
--> $DIR/top-level-alternation.rs:14:15 | ||
--> $DIR/top-level-alternation.rs:16:15 | ||
| | ||
LL | | Some(0) => {} | ||
| ^^^^^^^ | ||
|
||
error: unreachable pattern | ||
--> $DIR/top-level-alternation.rs:19:9 | ||
--> $DIR/top-level-alternation.rs:21:9 | ||
| | ||
LL | (0, 0) => {} | ||
| ^^^^^^ | ||
|
||
error: unreachable pattern | ||
--> $DIR/top-level-alternation.rs:39:9 | ||
--> $DIR/top-level-alternation.rs:41:9 | ||
| | ||
LL | _ => {} | ||
| ^ | ||
|
||
error: unreachable pattern | ||
--> $DIR/top-level-alternation.rs:43:9 | ||
--> $DIR/top-level-alternation.rs:45:9 | ||
| | ||
LL | Some(_) => {} | ||
| ^^^^^^^ | ||
|
||
error: unreachable pattern | ||
--> $DIR/top-level-alternation.rs:44:9 | ||
--> $DIR/top-level-alternation.rs:46:9 | ||
| | ||
LL | None => {} | ||
| ^^^^ | ||
|
||
error: unreachable pattern | ||
--> $DIR/top-level-alternation.rs:49:9 | ||
--> $DIR/top-level-alternation.rs:51:9 | ||
| | ||
LL | None | Some(_) => {} | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: unreachable pattern | ||
--> $DIR/top-level-alternation.rs:53:9 | ||
--> $DIR/top-level-alternation.rs:55:9 | ||
| | ||
LL | 1..=2 => {}, | ||
| ^^^^^ | ||
|
||
error: aborting due to 10 previous errors | ||
error: unreachable pattern | ||
--> $DIR/top-level-alternation.rs:58:14 | ||
| | ||
LL | let (0 | 0) = 0 else { return }; | ||
| ^ | ||
|
||
error: aborting due to 11 previous errors | ||
|