Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move recently changed tests to the correct file
  • Loading branch information
Nadrieril committed Dec 2, 2019
commit ef087d96f0fd44ce83ac8c44d11bbe3faa8e1c6a
28 changes: 0 additions & 28 deletions src/test/ui/or-patterns/exhaustiveness-pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,4 @@ fn main() {
((0, 0) | (1, 0),) => {}
_ => {}
}

match (0,) {
(1
| 1,) => {} //~ ERROR unreachable
_ => {}
}
match [0; 2] {
[0
| 0 //~ ERROR unreachable
, 0
| 0] => {} //~ ERROR unreachable
_ => {}
}
match &[][..] {
[0] => {}
[0, _] => {}
[0, _, _] => {}
[1, ..] => {}
[1 //~ ERROR unreachable
| 2, ..] => {}
_ => {}
}
match Some(0) {
Some(0) => {}
Some(0 //~ ERROR unreachable
| 1) => {}
_ => {}
}
}
38 changes: 1 addition & 37 deletions src/test/ui/or-patterns/exhaustiveness-pass.stderr
Original file line number Diff line number Diff line change
@@ -1,44 +1,8 @@
error: unreachable pattern
--> $DIR/exhaustiveness-pass.rs:48:12
|
LL | | 1,) => {}
| ^
|
note: lint level defined here
--> $DIR/exhaustiveness-pass.rs:4:9
|
LL | #![deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^

error: unreachable pattern
--> $DIR/exhaustiveness-pass.rs:55:15
|
LL | | 0] => {}
| ^

error: unreachable pattern
--> $DIR/exhaustiveness-pass.rs:53:15
|
LL | | 0
| ^

error: unreachable pattern
--> $DIR/exhaustiveness-pass.rs:63:10
|
LL | [1
| ^

error: unreachable pattern
--> $DIR/exhaustiveness-pass.rs:69:14
|
LL | Some(0
| ^

error: or-patterns are not fully implemented yet
--> $DIR/exhaustiveness-pass.rs:10:10
|
LL | (0 | _,) => {}
| ^^^^^

error: aborting due to 6 previous errors
error: aborting due to previous error

28 changes: 28 additions & 0 deletions src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,32 @@ fn main() {
((1..=4,),) => {}, //~ ERROR unreachable pattern
_ => {},
}

match (0,) {
(1
| 1,) => {} //~ ERROR unreachable
_ => {}
}
match [0; 2] {
[0
| 0 //~ ERROR unreachable
, 0
| 0] => {} //~ ERROR unreachable
_ => {}
}
match &[][..] {
[0] => {}
[0, _] => {}
[0, _, _] => {}
[1, ..] => {}
[1 //~ ERROR unreachable
| 2, ..] => {}
_ => {}
}
match Some(0) {
Some(0) => {}
Some(0 //~ ERROR unreachable
| 1) => {}
_ => {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,41 @@ error: unreachable pattern
LL | ((1..=4,),) => {},
| ^^^^^^^^^^^

error: unreachable pattern
--> $DIR/exhaustiveness-unreachable-pattern.rs:54:12
|
LL | | 1,) => {}
| ^

error: unreachable pattern
--> $DIR/exhaustiveness-unreachable-pattern.rs:61:15
|
LL | | 0] => {}
| ^

error: unreachable pattern
--> $DIR/exhaustiveness-unreachable-pattern.rs:59:15
|
LL | | 0
| ^

error: unreachable pattern
--> $DIR/exhaustiveness-unreachable-pattern.rs:69:10
|
LL | [1
| ^

error: unreachable pattern
--> $DIR/exhaustiveness-unreachable-pattern.rs:75:14
|
LL | Some(0
| ^

error: or-patterns are not fully implemented yet
--> $DIR/exhaustiveness-unreachable-pattern.rs:10:10
|
LL | (0 | _,) => {}
| ^^^^^

error: aborting due to 12 previous errors
error: aborting due to 17 previous errors