Skip to content

Commit ee27c49

Browse files
committed
Add NOTE annotations.
1 parent 320f6f4 commit ee27c49

File tree

3 files changed

+141
-75
lines changed

3 files changed

+141
-75
lines changed

tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr

+39-37
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: unreachable pattern
2-
--> $DIR/empty-match.rs:37:9
2+
--> $DIR/empty-match.rs:58:9
33
|
44
LL | _ => {},
55
| ^
@@ -11,25 +11,25 @@ LL | #![deny(unreachable_patterns)]
1111
| ^^^^^^^^^^^^^^^^^^^^
1212

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

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

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

3131
error[E0005]: refutable pattern in local binding
32-
--> $DIR/empty-match.rs:55:9
32+
--> $DIR/empty-match.rs:76:9
3333
|
3434
LL | let None = x;
3535
| ^^^^ pattern `Some(_)` not covered
@@ -44,19 +44,19 @@ LL | if let None = x { todo!() };
4444
| ++ +++++++++++
4545

4646
error: unreachable pattern
47-
--> $DIR/empty-match.rs:61:9
47+
--> $DIR/empty-match.rs:88:9
4848
|
4949
LL | _ => {},
5050
| ^
5151

5252
error: unreachable pattern
53-
--> $DIR/empty-match.rs:64:9
53+
--> $DIR/empty-match.rs:91:9
5454
|
5555
LL | _ if false => {},
5656
| ^
5757

5858
error[E0004]: non-exhaustive patterns: type `u8` is non-empty
59-
--> $DIR/empty-match.rs:82:20
59+
--> $DIR/empty-match.rs:109:20
6060
|
6161
LL | match_no_arms!(0u8);
6262
| ^^^
@@ -65,69 +65,69 @@ LL | match_no_arms!(0u8);
6565
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
6666

6767
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct1` is non-empty
68-
--> $DIR/empty-match.rs:83:20
68+
--> $DIR/empty-match.rs:111:20
6969
|
7070
LL | match_no_arms!(NonEmptyStruct1);
7171
| ^^^^^^^^^^^^^^^
7272
|
7373
note: `NonEmptyStruct1` defined here
74-
--> $DIR/empty-match.rs:14:8
74+
--> $DIR/empty-match.rs:15:8
7575
|
7676
LL | struct NonEmptyStruct1;
7777
| ^^^^^^^^^^^^^^^
7878
= note: the matched value is of type `NonEmptyStruct1`
7979
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
8080

8181
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct2` is non-empty
82-
--> $DIR/empty-match.rs:84:20
82+
--> $DIR/empty-match.rs:113:20
8383
|
8484
LL | match_no_arms!(NonEmptyStruct2(true));
8585
| ^^^^^^^^^^^^^^^^^^^^^
8686
|
8787
note: `NonEmptyStruct2` defined here
88-
--> $DIR/empty-match.rs:15:8
88+
--> $DIR/empty-match.rs:18:8
8989
|
9090
LL | struct NonEmptyStruct2(bool);
9191
| ^^^^^^^^^^^^^^^
9292
= note: the matched value is of type `NonEmptyStruct2`
9393
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
9494

9595
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
96-
--> $DIR/empty-match.rs:85:20
96+
--> $DIR/empty-match.rs:115:20
9797
|
9898
LL | match_no_arms!((NonEmptyUnion1 { foo: () }));
9999
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100100
|
101101
note: `NonEmptyUnion1` defined here
102-
--> $DIR/empty-match.rs:16:7
102+
--> $DIR/empty-match.rs:21:7
103103
|
104104
LL | union NonEmptyUnion1 {
105105
| ^^^^^^^^^^^^^^
106106
= note: the matched value is of type `NonEmptyUnion1`
107107
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
108108

109109
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
110-
--> $DIR/empty-match.rs:86:20
110+
--> $DIR/empty-match.rs:117:20
111111
|
112112
LL | match_no_arms!((NonEmptyUnion2 { foo: () }));
113113
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114114
|
115115
note: `NonEmptyUnion2` defined here
116-
--> $DIR/empty-match.rs:19:7
116+
--> $DIR/empty-match.rs:26:7
117117
|
118118
LL | union NonEmptyUnion2 {
119119
| ^^^^^^^^^^^^^^
120120
= note: the matched value is of type `NonEmptyUnion2`
121121
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
122122

123123
error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
124-
--> $DIR/empty-match.rs:87:20
124+
--> $DIR/empty-match.rs:119:20
125125
|
126126
LL | match_no_arms!(NonEmptyEnum1::Foo(true));
127127
| ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
128128
|
129129
note: `NonEmptyEnum1` defined here
130-
--> $DIR/empty-match.rs:24:5
130+
--> $DIR/empty-match.rs:33:5
131131
|
132132
LL | enum NonEmptyEnum1 {
133133
| -------------
@@ -137,39 +137,40 @@ LL | Foo(bool),
137137
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern
138138

139139
error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
140-
--> $DIR/empty-match.rs:88:20
140+
--> $DIR/empty-match.rs:122:20
141141
|
142142
LL | match_no_arms!(NonEmptyEnum2::Foo(true));
143143
| ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
144144
|
145145
note: `NonEmptyEnum2` defined here
146-
--> $DIR/empty-match.rs:27:5
146+
--> $DIR/empty-match.rs:40:5
147147
|
148148
LL | enum NonEmptyEnum2 {
149149
| -------------
150150
LL | Foo(bool),
151151
| ^^^ not covered
152+
...
152153
LL | Bar,
153154
| ^^^ not covered
154155
= note: the matched value is of type `NonEmptyEnum2`
155156
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
156157

157158
error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
158-
--> $DIR/empty-match.rs:89:20
159+
--> $DIR/empty-match.rs:125:20
159160
|
160161
LL | match_no_arms!(NonEmptyEnum5::V1);
161162
| ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
162163
|
163164
note: `NonEmptyEnum5` defined here
164-
--> $DIR/empty-match.rs:30:6
165+
--> $DIR/empty-match.rs:49:6
165166
|
166167
LL | enum NonEmptyEnum5 {
167168
| ^^^^^^^^^^^^^
168169
= note: the matched value is of type `NonEmptyEnum5`
169170
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
170171

171172
error[E0004]: non-exhaustive patterns: `_` not covered
172-
--> $DIR/empty-match.rs:91:24
173+
--> $DIR/empty-match.rs:129:24
173174
|
174175
LL | match_guarded_arm!(0u8);
175176
| ^^^ pattern `_` not covered
@@ -182,13 +183,13 @@ LL + _ => todo!()
182183
|
183184

184185
error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered
185-
--> $DIR/empty-match.rs:92:24
186+
--> $DIR/empty-match.rs:133:24
186187
|
187188
LL | match_guarded_arm!(NonEmptyStruct1);
188189
| ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered
189190
|
190191
note: `NonEmptyStruct1` defined here
191-
--> $DIR/empty-match.rs:14:8
192+
--> $DIR/empty-match.rs:15:8
192193
|
193194
LL | struct NonEmptyStruct1;
194195
| ^^^^^^^^^^^^^^^
@@ -200,13 +201,13 @@ LL + NonEmptyStruct1 => todo!()
200201
|
201202

202203
error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered
203-
--> $DIR/empty-match.rs:93:24
204+
--> $DIR/empty-match.rs:137:24
204205
|
205206
LL | match_guarded_arm!(NonEmptyStruct2(true));
206207
| ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered
207208
|
208209
note: `NonEmptyStruct2` defined here
209-
--> $DIR/empty-match.rs:15:8
210+
--> $DIR/empty-match.rs:18:8
210211
|
211212
LL | struct NonEmptyStruct2(bool);
212213
| ^^^^^^^^^^^^^^^
@@ -218,13 +219,13 @@ LL + NonEmptyStruct2(_) => todo!()
218219
|
219220

220221
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
221-
--> $DIR/empty-match.rs:94:24
222+
--> $DIR/empty-match.rs:141:24
222223
|
223224
LL | match_guarded_arm!((NonEmptyUnion1 { foo: () }));
224225
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered
225226
|
226227
note: `NonEmptyUnion1` defined here
227-
--> $DIR/empty-match.rs:16:7
228+
--> $DIR/empty-match.rs:21:7
228229
|
229230
LL | union NonEmptyUnion1 {
230231
| ^^^^^^^^^^^^^^
@@ -236,13 +237,13 @@ LL + NonEmptyUnion1 { .. } => todo!()
236237
|
237238

238239
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
239-
--> $DIR/empty-match.rs:95:24
240+
--> $DIR/empty-match.rs:145:24
240241
|
241242
LL | match_guarded_arm!((NonEmptyUnion2 { foo: () }));
242243
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered
243244
|
244245
note: `NonEmptyUnion2` defined here
245-
--> $DIR/empty-match.rs:19:7
246+
--> $DIR/empty-match.rs:26:7
246247
|
247248
LL | union NonEmptyUnion2 {
248249
| ^^^^^^^^^^^^^^
@@ -254,13 +255,13 @@ LL + NonEmptyUnion2 { .. } => todo!()
254255
|
255256

256257
error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
257-
--> $DIR/empty-match.rs:96:24
258+
--> $DIR/empty-match.rs:149:24
258259
|
259260
LL | match_guarded_arm!(NonEmptyEnum1::Foo(true));
260261
| ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
261262
|
262263
note: `NonEmptyEnum1` defined here
263-
--> $DIR/empty-match.rs:24:5
264+
--> $DIR/empty-match.rs:33:5
264265
|
265266
LL | enum NonEmptyEnum1 {
266267
| -------------
@@ -274,18 +275,19 @@ LL + NonEmptyEnum1::Foo(_) => todo!()
274275
|
275276

276277
error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
277-
--> $DIR/empty-match.rs:97:24
278+
--> $DIR/empty-match.rs:153:24
278279
|
279280
LL | match_guarded_arm!(NonEmptyEnum2::Foo(true));
280281
| ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
281282
|
282283
note: `NonEmptyEnum2` defined here
283-
--> $DIR/empty-match.rs:27:5
284+
--> $DIR/empty-match.rs:40:5
284285
|
285286
LL | enum NonEmptyEnum2 {
286287
| -------------
287288
LL | Foo(bool),
288289
| ^^^ not covered
290+
...
289291
LL | Bar,
290292
| ^^^ not covered
291293
= note: the matched value is of type `NonEmptyEnum2`
@@ -296,13 +298,13 @@ LL + NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!()
296298
|
297299

298300
error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
299-
--> $DIR/empty-match.rs:98:24
301+
--> $DIR/empty-match.rs:157:24
300302
|
301303
LL | match_guarded_arm!(NonEmptyEnum5::V1);
302304
| ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
303305
|
304306
note: `NonEmptyEnum5` defined here
305-
--> $DIR/empty-match.rs:30:6
307+
--> $DIR/empty-match.rs:49:6
306308
|
307309
LL | enum NonEmptyEnum5 {
308310
| ^^^^^^^^^^^^^

0 commit comments

Comments
 (0)