1
Fork 0

Move recently changed tests to the correct file

This commit is contained in:
Nadrieril 2019-11-29 13:02:14 +00:00
parent a476af22e8
commit ef087d96f0
4 changed files with 60 additions and 66 deletions

View file

@ -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) => {}
_ => {}
}
}

View file

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

View file

@ -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) => {}
_ => {}
}
}

View file

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