Skip to content

Commit 622bfdb

Browse files
committed
Deduplicate some tests using revisions
1 parent 497c9a2 commit 622bfdb

8 files changed

+74
-227
lines changed

src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.stderr renamed to src/test/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
11
error: unreachable pattern
2-
--> $DIR/match-empty-exhaustive_patterns.rs:52:9
2+
--> $DIR/empty-match.rs:53:9
33
|
44
LL | _ => {},
55
| ^
66
|
77
note: the lint level is defined here
8-
--> $DIR/match-empty-exhaustive_patterns.rs:5:9
8+
--> $DIR/empty-match.rs:6:9
99
|
1010
LL | #![deny(unreachable_patterns)]
1111
| ^^^^^^^^^^^^^^^^^^^^
1212

1313
error: unreachable pattern
14-
--> $DIR/match-empty-exhaustive_patterns.rs:55:9
14+
--> $DIR/empty-match.rs:56:9
1515
|
1616
LL | _ if false => {},
1717
| ^
1818

1919
error: unreachable pattern
20-
--> $DIR/match-empty-exhaustive_patterns.rs:62:9
20+
--> $DIR/empty-match.rs:63:9
2121
|
2222
LL | _ => {},
2323
| ^
2424

2525
error: unreachable pattern
26-
--> $DIR/match-empty-exhaustive_patterns.rs:65:9
26+
--> $DIR/empty-match.rs:66:9
2727
|
2828
LL | _ if false => {},
2929
| ^
3030

3131
error: unreachable pattern
32-
--> $DIR/match-empty-exhaustive_patterns.rs:72:9
32+
--> $DIR/empty-match.rs:73:9
3333
|
3434
LL | _ => {},
3535
| ^
3636

3737
error: unreachable pattern
38-
--> $DIR/match-empty-exhaustive_patterns.rs:75:9
38+
--> $DIR/empty-match.rs:76:9
3939
|
4040
LL | _ if false => {},
4141
| ^
4242

4343
error: unreachable pattern
44-
--> $DIR/match-empty-exhaustive_patterns.rs:82:9
44+
--> $DIR/empty-match.rs:83:9
4545
|
4646
LL | Some(_) => {}
4747
| ^^^^^^^
4848

4949
error: unreachable pattern
50-
--> $DIR/match-empty-exhaustive_patterns.rs:86:9
50+
--> $DIR/empty-match.rs:87:9
5151
|
5252
LL | Some(_) => {}
5353
| ^^^^^^^
5454

5555
error[E0004]: non-exhaustive patterns: type `u8` is non-empty
56-
--> $DIR/match-empty-exhaustive_patterns.rs:89:18
56+
--> $DIR/empty-match.rs:90:18
5757
|
5858
LL | match_empty!(0u8);
5959
| ^^^
@@ -62,7 +62,7 @@ LL | match_empty!(0u8);
6262
= note: the matched value is of type `u8`
6363

6464
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct` is non-empty
65-
--> $DIR/match-empty-exhaustive_patterns.rs:91:18
65+
--> $DIR/empty-match.rs:92:18
6666
|
6767
LL | struct NonEmptyStruct(bool);
6868
| ---------------------------- `NonEmptyStruct` defined here
@@ -74,7 +74,7 @@ LL | match_empty!(NonEmptyStruct(true));
7474
= note: the matched value is of type `NonEmptyStruct`
7575

7676
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
77-
--> $DIR/match-empty-exhaustive_patterns.rs:93:18
77+
--> $DIR/empty-match.rs:94:18
7878
|
7979
LL | / union NonEmptyUnion1 {
8080
LL | | foo: (),
@@ -88,7 +88,7 @@ LL | match_empty!((NonEmptyUnion1 { foo: () }));
8888
= note: the matched value is of type `NonEmptyUnion1`
8989

9090
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
91-
--> $DIR/match-empty-exhaustive_patterns.rs:95:18
91+
--> $DIR/empty-match.rs:96:18
9292
|
9393
LL | / union NonEmptyUnion2 {
9494
LL | | foo: (),
@@ -103,7 +103,7 @@ LL | match_empty!((NonEmptyUnion2 { foo: () }));
103103
= note: the matched value is of type `NonEmptyUnion2`
104104

105105
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
106-
--> $DIR/match-empty-exhaustive_patterns.rs:97:18
106+
--> $DIR/empty-match.rs:98:18
107107
|
108108
LL | / enum NonEmptyEnum1 {
109109
LL | | Foo(bool),
@@ -120,7 +120,7 @@ LL | match_empty!(NonEmptyEnum1::Foo(true));
120120
= note: the matched value is of type `NonEmptyEnum1`
121121

122122
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
123-
--> $DIR/match-empty-exhaustive_patterns.rs:99:18
123+
--> $DIR/empty-match.rs:100:18
124124
|
125125
LL | / enum NonEmptyEnum2 {
126126
LL | | Foo(bool),
@@ -141,7 +141,7 @@ LL | match_empty!(NonEmptyEnum2::Foo(true));
141141
= note: the matched value is of type `NonEmptyEnum2`
142142

143143
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
144-
--> $DIR/match-empty-exhaustive_patterns.rs:101:18
144+
--> $DIR/empty-match.rs:102:18
145145
|
146146
LL | / enum NonEmptyEnum5 {
147147
LL | | V1, V2, V3, V4, V5,
@@ -155,7 +155,7 @@ LL | match_empty!(NonEmptyEnum5::V1);
155155
= note: the matched value is of type `NonEmptyEnum5`
156156

157157
error[E0004]: non-exhaustive patterns: `_` not covered
158-
--> $DIR/match-empty-exhaustive_patterns.rs:104:18
158+
--> $DIR/empty-match.rs:105:18
159159
|
160160
LL | match_false!(0u8);
161161
| ^^^ pattern `_` not covered
@@ -164,7 +164,7 @@ LL | match_false!(0u8);
164164
= note: the matched value is of type `u8`
165165

166166
error[E0004]: non-exhaustive patterns: `NonEmptyStruct(_)` not covered
167-
--> $DIR/match-empty-exhaustive_patterns.rs:106:18
167+
--> $DIR/empty-match.rs:107:18
168168
|
169169
LL | struct NonEmptyStruct(bool);
170170
| ---------------------------- `NonEmptyStruct` defined here
@@ -176,7 +176,7 @@ LL | match_false!(NonEmptyStruct(true));
176176
= note: the matched value is of type `NonEmptyStruct`
177177

178178
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
179-
--> $DIR/match-empty-exhaustive_patterns.rs:108:18
179+
--> $DIR/empty-match.rs:109:18
180180
|
181181
LL | / union NonEmptyUnion1 {
182182
LL | | foo: (),
@@ -190,7 +190,7 @@ LL | match_false!((NonEmptyUnion1 { foo: () }));
190190
= note: the matched value is of type `NonEmptyUnion1`
191191

192192
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
193-
--> $DIR/match-empty-exhaustive_patterns.rs:110:18
193+
--> $DIR/empty-match.rs:111:18
194194
|
195195
LL | / union NonEmptyUnion2 {
196196
LL | | foo: (),
@@ -205,7 +205,7 @@ LL | match_false!((NonEmptyUnion2 { foo: () }));
205205
= note: the matched value is of type `NonEmptyUnion2`
206206

207207
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
208-
--> $DIR/match-empty-exhaustive_patterns.rs:112:18
208+
--> $DIR/empty-match.rs:113:18
209209
|
210210
LL | / enum NonEmptyEnum1 {
211211
LL | | Foo(bool),
@@ -222,7 +222,7 @@ LL | match_false!(NonEmptyEnum1::Foo(true));
222222
= note: the matched value is of type `NonEmptyEnum1`
223223

224224
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
225-
--> $DIR/match-empty-exhaustive_patterns.rs:114:18
225+
--> $DIR/empty-match.rs:115:18
226226
|
227227
LL | / enum NonEmptyEnum2 {
228228
LL | | Foo(bool),
@@ -243,7 +243,7 @@ LL | match_false!(NonEmptyEnum2::Foo(true));
243243
= note: the matched value is of type `NonEmptyEnum2`
244244

245245
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
246-
--> $DIR/match-empty-exhaustive_patterns.rs:116:18
246+
--> $DIR/empty-match.rs:117:18
247247
|
248248
LL | / enum NonEmptyEnum5 {
249249
LL | | V1, V2, V3, V4, V5,

src/test/ui/pattern/usefulness/match-empty.stderr renamed to src/test/ui/pattern/usefulness/empty-match.normal.stderr

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
error: unreachable pattern
2-
--> $DIR/match-empty.rs:51:9
2+
--> $DIR/empty-match.rs:53:9
33
|
44
LL | _ => {},
55
| ^
66
|
77
note: the lint level is defined here
8-
--> $DIR/match-empty.rs:4:9
8+
--> $DIR/empty-match.rs:6:9
99
|
1010
LL | #![deny(unreachable_patterns)]
1111
| ^^^^^^^^^^^^^^^^^^^^
1212

1313
error: unreachable pattern
14-
--> $DIR/match-empty.rs:54:9
14+
--> $DIR/empty-match.rs:56:9
1515
|
1616
LL | _ if false => {},
1717
| ^
1818

1919
error: unreachable pattern
20-
--> $DIR/match-empty.rs:61:9
20+
--> $DIR/empty-match.rs:63:9
2121
|
2222
LL | _ => {},
2323
| ^
2424

2525
error: unreachable pattern
26-
--> $DIR/match-empty.rs:64:9
26+
--> $DIR/empty-match.rs:66:9
2727
|
2828
LL | _ if false => {},
2929
| ^
3030

3131
error: unreachable pattern
32-
--> $DIR/match-empty.rs:71:9
32+
--> $DIR/empty-match.rs:73:9
3333
|
3434
LL | _ => {},
3535
| ^
3636

3737
error: unreachable pattern
38-
--> $DIR/match-empty.rs:74:9
38+
--> $DIR/empty-match.rs:76:9
3939
|
4040
LL | _ if false => {},
4141
| ^
4242

4343
error[E0004]: non-exhaustive patterns: type `u8` is non-empty
44-
--> $DIR/match-empty.rs:89:18
44+
--> $DIR/empty-match.rs:90:18
4545
|
4646
LL | match_empty!(0u8);
4747
| ^^^
@@ -50,7 +50,7 @@ LL | match_empty!(0u8);
5050
= note: the matched value is of type `u8`
5151

5252
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct` is non-empty
53-
--> $DIR/match-empty.rs:91:18
53+
--> $DIR/empty-match.rs:92:18
5454
|
5555
LL | struct NonEmptyStruct(bool);
5656
| ---------------------------- `NonEmptyStruct` defined here
@@ -62,7 +62,7 @@ LL | match_empty!(NonEmptyStruct(true));
6262
= note: the matched value is of type `NonEmptyStruct`
6363

6464
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
65-
--> $DIR/match-empty.rs:93:18
65+
--> $DIR/empty-match.rs:94:18
6666
|
6767
LL | / union NonEmptyUnion1 {
6868
LL | | foo: (),
@@ -76,7 +76,7 @@ LL | match_empty!((NonEmptyUnion1 { foo: () }));
7676
= note: the matched value is of type `NonEmptyUnion1`
7777

7878
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
79-
--> $DIR/match-empty.rs:95:18
79+
--> $DIR/empty-match.rs:96:18
8080
|
8181
LL | / union NonEmptyUnion2 {
8282
LL | | foo: (),
@@ -91,7 +91,7 @@ LL | match_empty!((NonEmptyUnion2 { foo: () }));
9191
= note: the matched value is of type `NonEmptyUnion2`
9292

9393
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
94-
--> $DIR/match-empty.rs:97:18
94+
--> $DIR/empty-match.rs:98:18
9595
|
9696
LL | / enum NonEmptyEnum1 {
9797
LL | | Foo(bool),
@@ -108,7 +108,7 @@ LL | match_empty!(NonEmptyEnum1::Foo(true));
108108
= note: the matched value is of type `NonEmptyEnum1`
109109

110110
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
111-
--> $DIR/match-empty.rs:99:18
111+
--> $DIR/empty-match.rs:100:18
112112
|
113113
LL | / enum NonEmptyEnum2 {
114114
LL | | Foo(bool),
@@ -129,7 +129,7 @@ LL | match_empty!(NonEmptyEnum2::Foo(true));
129129
= note: the matched value is of type `NonEmptyEnum2`
130130

131131
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
132-
--> $DIR/match-empty.rs:101:18
132+
--> $DIR/empty-match.rs:102:18
133133
|
134134
LL | / enum NonEmptyEnum5 {
135135
LL | | V1, V2, V3, V4, V5,
@@ -143,7 +143,7 @@ LL | match_empty!(NonEmptyEnum5::V1);
143143
= note: the matched value is of type `NonEmptyEnum5`
144144

145145
error[E0004]: non-exhaustive patterns: `_` not covered
146-
--> $DIR/match-empty.rs:104:18
146+
--> $DIR/empty-match.rs:105:18
147147
|
148148
LL | match_false!(0u8);
149149
| ^^^ pattern `_` not covered
@@ -152,7 +152,7 @@ LL | match_false!(0u8);
152152
= note: the matched value is of type `u8`
153153

154154
error[E0004]: non-exhaustive patterns: `NonEmptyStruct(_)` not covered
155-
--> $DIR/match-empty.rs:106:18
155+
--> $DIR/empty-match.rs:107:18
156156
|
157157
LL | struct NonEmptyStruct(bool);
158158
| ---------------------------- `NonEmptyStruct` defined here
@@ -164,7 +164,7 @@ LL | match_false!(NonEmptyStruct(true));
164164
= note: the matched value is of type `NonEmptyStruct`
165165

166166
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
167-
--> $DIR/match-empty.rs:108:18
167+
--> $DIR/empty-match.rs:109:18
168168
|
169169
LL | / union NonEmptyUnion1 {
170170
LL | | foo: (),
@@ -178,7 +178,7 @@ LL | match_false!((NonEmptyUnion1 { foo: () }));
178178
= note: the matched value is of type `NonEmptyUnion1`
179179

180180
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
181-
--> $DIR/match-empty.rs:110:18
181+
--> $DIR/empty-match.rs:111:18
182182
|
183183
LL | / union NonEmptyUnion2 {
184184
LL | | foo: (),
@@ -193,7 +193,7 @@ LL | match_false!((NonEmptyUnion2 { foo: () }));
193193
= note: the matched value is of type `NonEmptyUnion2`
194194

195195
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
196-
--> $DIR/match-empty.rs:112:18
196+
--> $DIR/empty-match.rs:113:18
197197
|
198198
LL | / enum NonEmptyEnum1 {
199199
LL | | Foo(bool),
@@ -210,7 +210,7 @@ LL | match_false!(NonEmptyEnum1::Foo(true));
210210
= note: the matched value is of type `NonEmptyEnum1`
211211

212212
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
213-
--> $DIR/match-empty.rs:114:18
213+
--> $DIR/empty-match.rs:115:18
214214
|
215215
LL | / enum NonEmptyEnum2 {
216216
LL | | Foo(bool),
@@ -231,7 +231,7 @@ LL | match_false!(NonEmptyEnum2::Foo(true));
231231
= note: the matched value is of type `NonEmptyEnum2`
232232

233233
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
234-
--> $DIR/match-empty.rs:116:18
234+
--> $DIR/empty-match.rs:117:18
235235
|
236236
LL | / enum NonEmptyEnum5 {
237237
LL | | V1, V2, V3, V4, V5,

src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.rs renamed to src/test/ui/pattern/usefulness/empty-match.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// aux-build:empty.rs
2+
// revisions: normal exhaustive_patterns
23
#![feature(never_type)]
34
#![feature(never_type_fallback)]
4-
#![feature(exhaustive_patterns)]
5+
#![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
56
#![deny(unreachable_patterns)]
67

78
extern crate empty;
@@ -79,11 +80,11 @@ fn never(x: !) {
7980
fn main() {
8081
match None::<!> {
8182
None => {}
82-
Some(_) => {} //~ ERROR unreachable pattern
83+
Some(_) => {} //[exhaustive_patterns]~ ERROR unreachable pattern
8384
}
8485
match None::<EmptyEnum> {
8586
None => {}
86-
Some(_) => {} //~ ERROR unreachable pattern
87+
Some(_) => {} //[exhaustive_patterns]~ ERROR unreachable pattern
8788
}
8889

8990
match_empty!(0u8);

0 commit comments

Comments
 (0)