Skip to content

Commit ef087d9

Browse files
committed
Move recently changed tests to the correct file
1 parent a476af2 commit ef087d9

4 files changed

+60
-66
lines changed

src/test/ui/or-patterns/exhaustiveness-pass.rs

-28
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,4 @@ fn main() {
4242
((0, 0) | (1, 0),) => {}
4343
_ => {}
4444
}
45-
46-
match (0,) {
47-
(1
48-
| 1,) => {} //~ ERROR unreachable
49-
_ => {}
50-
}
51-
match [0; 2] {
52-
[0
53-
| 0 //~ ERROR unreachable
54-
, 0
55-
| 0] => {} //~ ERROR unreachable
56-
_ => {}
57-
}
58-
match &[][..] {
59-
[0] => {}
60-
[0, _] => {}
61-
[0, _, _] => {}
62-
[1, ..] => {}
63-
[1 //~ ERROR unreachable
64-
| 2, ..] => {}
65-
_ => {}
66-
}
67-
match Some(0) {
68-
Some(0) => {}
69-
Some(0 //~ ERROR unreachable
70-
| 1) => {}
71-
_ => {}
72-
}
7345
}
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,8 @@
1-
error: unreachable pattern
2-
--> $DIR/exhaustiveness-pass.rs:48:12
3-
|
4-
LL | | 1,) => {}
5-
| ^
6-
|
7-
note: lint level defined here
8-
--> $DIR/exhaustiveness-pass.rs:4:9
9-
|
10-
LL | #![deny(unreachable_patterns)]
11-
| ^^^^^^^^^^^^^^^^^^^^
12-
13-
error: unreachable pattern
14-
--> $DIR/exhaustiveness-pass.rs:55:15
15-
|
16-
LL | | 0] => {}
17-
| ^
18-
19-
error: unreachable pattern
20-
--> $DIR/exhaustiveness-pass.rs:53:15
21-
|
22-
LL | | 0
23-
| ^
24-
25-
error: unreachable pattern
26-
--> $DIR/exhaustiveness-pass.rs:63:10
27-
|
28-
LL | [1
29-
| ^
30-
31-
error: unreachable pattern
32-
--> $DIR/exhaustiveness-pass.rs:69:14
33-
|
34-
LL | Some(0
35-
| ^
36-
371
error: or-patterns are not fully implemented yet
382
--> $DIR/exhaustiveness-pass.rs:10:10
393
|
404
LL | (0 | _,) => {}
415
| ^^^^^
426

43-
error: aborting due to 6 previous errors
7+
error: aborting due to previous error
448

src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.rs

+28
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,32 @@ fn main() {
4848
((1..=4,),) => {}, //~ ERROR unreachable pattern
4949
_ => {},
5050
}
51+
52+
match (0,) {
53+
(1
54+
| 1,) => {} //~ ERROR unreachable
55+
_ => {}
56+
}
57+
match [0; 2] {
58+
[0
59+
| 0 //~ ERROR unreachable
60+
, 0
61+
| 0] => {} //~ ERROR unreachable
62+
_ => {}
63+
}
64+
match &[][..] {
65+
[0] => {}
66+
[0, _] => {}
67+
[0, _, _] => {}
68+
[1, ..] => {}
69+
[1 //~ ERROR unreachable
70+
| 2, ..] => {}
71+
_ => {}
72+
}
73+
match Some(0) {
74+
Some(0) => {}
75+
Some(0 //~ ERROR unreachable
76+
| 1) => {}
77+
_ => {}
78+
}
5179
}

src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.stderr

+31-1
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,41 @@ error: unreachable pattern
7070
LL | ((1..=4,),) => {},
7171
| ^^^^^^^^^^^
7272

73+
error: unreachable pattern
74+
--> $DIR/exhaustiveness-unreachable-pattern.rs:54:12
75+
|
76+
LL | | 1,) => {}
77+
| ^
78+
79+
error: unreachable pattern
80+
--> $DIR/exhaustiveness-unreachable-pattern.rs:61:15
81+
|
82+
LL | | 0] => {}
83+
| ^
84+
85+
error: unreachable pattern
86+
--> $DIR/exhaustiveness-unreachable-pattern.rs:59:15
87+
|
88+
LL | | 0
89+
| ^
90+
91+
error: unreachable pattern
92+
--> $DIR/exhaustiveness-unreachable-pattern.rs:69:10
93+
|
94+
LL | [1
95+
| ^
96+
97+
error: unreachable pattern
98+
--> $DIR/exhaustiveness-unreachable-pattern.rs:75:14
99+
|
100+
LL | Some(0
101+
| ^
102+
73103
error: or-patterns are not fully implemented yet
74104
--> $DIR/exhaustiveness-unreachable-pattern.rs:10:10
75105
|
76106
LL | (0 | _,) => {}
77107
| ^^^^^
78108

79-
error: aborting due to 12 previous errors
109+
error: aborting due to 17 previous errors
80110

0 commit comments

Comments
 (0)