You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/ui/pattern/usefulness/empty-types.never_pats.stderr
+53-53Lines changed: 53 additions & 53 deletions
Original file line number
Diff line number
Diff line change
@@ -74,11 +74,11 @@ error: unreachable pattern
74
74
LL | _ => {}
75
75
| ^
76
76
77
-
error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(_)` not covered
77
+
error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(!)` not covered
78
78
--> $DIR/empty-types.rs:91:11
79
79
|
80
80
LL | match res_u32_never {}
81
-
| ^^^^^^^^^^^^^ patterns `Ok(_)` and `Err(_)` not covered
81
+
| ^^^^^^^^^^^^^ patterns `Ok(_)` and `Err(!)` not covered
82
82
|
83
83
note: `Result<u32, !>` defined here
84
84
--> $SRC_DIR/core/src/result.rs:LL:COL
@@ -92,15 +92,15 @@ note: `Result<u32, !>` defined here
92
92
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
93
93
|
94
94
LL ~ match res_u32_never {
95
-
LL + Ok(_) | Err(_) => todo!(),
95
+
LL + Ok(_) | Err(!) => todo!(),
96
96
LL + }
97
97
|
98
98
99
-
error[E0004]: non-exhaustive patterns: `Err(_)` not covered
99
+
error[E0004]: non-exhaustive patterns: `Err(!)` not covered
100
100
--> $DIR/empty-types.rs:93:11
101
101
|
102
102
LL | match res_u32_never {
103
-
| ^^^^^^^^^^^^^ pattern `Err(_)` not covered
103
+
| ^^^^^^^^^^^^^ pattern `Err(!)` not covered
104
104
|
105
105
note: `Result<u32, !>` defined here
106
106
--> $SRC_DIR/core/src/result.rs:LL:COL
@@ -111,7 +111,7 @@ note: `Result<u32, !>` defined here
111
111
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
112
112
|
113
113
LL ~ Ok(_) => {},
114
-
LL + Err(_) => todo!()
114
+
LL + Err(!) => todo!()
115
115
|
116
116
117
117
error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered
@@ -136,7 +136,7 @@ error[E0005]: refutable pattern in local binding
136
136
--> $DIR/empty-types.rs:106:9
137
137
|
138
138
LL | let Ok(_x) = res_u32_never;
139
-
| ^^^^^^ pattern `Err(_)` not covered
139
+
| ^^^^^^ pattern `Err(!)` not covered
140
140
|
141
141
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
142
142
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
@@ -164,7 +164,7 @@ error[E0005]: refutable pattern in local binding
164
164
--> $DIR/empty-types.rs:112:9
165
165
|
166
166
LL | let Ok(_x) = &res_u32_never;
167
-
| ^^^^^^ pattern `&Err(_)` not covered
167
+
| ^^^^^^ pattern `&Err(!)` not covered
168
168
|
169
169
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
170
170
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
@@ -174,11 +174,11 @@ help: you might want to use `let else` to handle the variant that isn't matched
174
174
LL | let Ok(_x) = &res_u32_never else { todo!() };
175
175
| ++++++++++++++++
176
176
177
-
error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(_)` not covered
177
+
error[E0004]: non-exhaustive patterns: `Ok(!)` and `Err(!)` not covered
178
178
--> $DIR/empty-types.rs:116:11
179
179
|
180
180
LL | match result_never {}
181
-
| ^^^^^^^^^^^^ patterns `Ok(_)` and `Err(_)` not covered
181
+
| ^^^^^^^^^^^^ patterns `Ok(!)` and `Err(!)` not covered
182
182
|
183
183
note: `Result<!, !>` defined here
184
184
--> $SRC_DIR/core/src/result.rs:LL:COL
@@ -192,15 +192,15 @@ note: `Result<!, !>` defined here
192
192
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
193
193
|
194
194
LL ~ match result_never {
195
-
LL + Ok(_) | Err(_) => todo!(),
195
+
LL + Ok(!) | Err(!) => todo!(),
196
196
LL + }
197
197
|
198
198
199
-
error[E0004]: non-exhaustive patterns: `Err(_)` not covered
199
+
error[E0004]: non-exhaustive patterns: `Err(!)` not covered
200
200
--> $DIR/empty-types.rs:121:11
201
201
|
202
202
LL | match result_never {
203
-
| ^^^^^^^^^^^^ pattern `Err(_)` not covered
203
+
| ^^^^^^^^^^^^ pattern `Err(!)` not covered
204
204
|
205
205
note: `Result<!, !>` defined here
206
206
--> $SRC_DIR/core/src/result.rs:LL:COL
@@ -210,7 +210,7 @@ note: `Result<!, !>` defined here
210
210
= note: the matched value is of type `Result<!, !>`
211
211
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
212
212
|
213
-
LL | Ok(_) => {}, Err(_) => todo!()
213
+
LL | Ok(_) => {}, Err(!) => todo!()
214
214
| +++++++++++++++++++
215
215
216
216
error: unreachable pattern
@@ -225,11 +225,11 @@ error: unreachable pattern
225
225
LL | _ if false => {}
226
226
| ^
227
227
228
-
error[E0004]: non-exhaustive patterns: `Some(_)` not covered
228
+
error[E0004]: non-exhaustive patterns: `Some(!)` not covered
229
229
--> $DIR/empty-types.rs:146:15
230
230
|
231
231
LL | match opt_void {
232
-
| ^^^^^^^^ pattern `Some(_)` not covered
232
+
| ^^^^^^^^ pattern `Some(!)` not covered
233
233
|
234
234
note: `Option<Void>` defined here
235
235
--> $SRC_DIR/core/src/option.rs:LL:COL
@@ -240,14 +240,14 @@ note: `Option<Void>` defined here
240
240
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
241
241
|
242
242
LL ~ None => {},
243
-
LL + Some(_) => todo!()
243
+
LL + Some(!) => todo!()
244
244
|
245
245
246
-
error[E0004]: non-exhaustive patterns: `Some(_)` not covered
246
+
error[E0004]: non-exhaustive patterns: `Some(!)` not covered
247
247
--> $DIR/empty-types.rs:165:15
248
248
|
249
249
LL | match *ref_opt_void {
250
-
| ^^^^^^^^^^^^^ pattern `Some(_)` not covered
250
+
| ^^^^^^^^^^^^^ pattern `Some(!)` not covered
251
251
|
252
252
note: `Option<Void>` defined here
253
253
--> $SRC_DIR/core/src/option.rs:LL:COL
@@ -258,7 +258,7 @@ note: `Option<Void>` defined here
258
258
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
259
259
|
260
260
LL ~ None => {},
261
-
LL + Some(_) => todo!()
261
+
LL + Some(!) => todo!()
262
262
|
263
263
264
264
error: unreachable pattern
@@ -325,11 +325,11 @@ LL + _ => todo!(),
325
325
LL ~ }
326
326
|
327
327
328
-
error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(_)` not covered
328
+
error[E0004]: non-exhaustive patterns: `Ok(!)` and `Err(!)` not covered
329
329
--> $DIR/empty-types.rs:320:11
330
330
|
331
331
LL | match *x {}
332
-
| ^^ patterns `Ok(_)` and `Err(_)` not covered
332
+
| ^^ patterns `Ok(!)` and `Err(!)` not covered
333
333
|
334
334
note: `Result<!, !>` defined here
335
335
--> $SRC_DIR/core/src/result.rs:LL:COL
@@ -343,7 +343,7 @@ note: `Result<!, !>` defined here
343
343
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
344
344
|
345
345
LL ~ match *x {
346
-
LL + Ok(_) | Err(_) => todo!(),
346
+
LL + Ok(!) | Err(!) => todo!(),
347
347
LL ~ }
348
348
|
349
349
@@ -375,44 +375,44 @@ LL + _ => todo!(),
375
375
LL + }
376
376
|
377
377
378
-
error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
378
+
error[E0004]: non-exhaustive patterns: `&[!, ..]` not covered
379
379
--> $DIR/empty-types.rs:329:11
380
380
|
381
381
LL | match slice_never {
382
-
| ^^^^^^^^^^^ pattern `&[_, ..]` not covered
382
+
| ^^^^^^^^^^^ pattern `&[!, ..]` not covered
383
383
|
384
384
= note: the matched value is of type `&[!]`
385
385
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
386
386
|
387
387
LL ~ [] => {},
388
-
LL + &[_, ..] => todo!()
388
+
LL + &[!, ..] => todo!()
389
389
|
390
390
391
-
error[E0004]: non-exhaustive patterns: `&[]`, `&[_]` and `&[_, _]` not covered
391
+
error[E0004]: non-exhaustive patterns: `&[]`, `&[!]` and `&[!, !]` not covered
392
392
--> $DIR/empty-types.rs:338:11
393
393
|
394
394
LL | match slice_never {
395
-
| ^^^^^^^^^^^ patterns `&[]`, `&[_]` and `&[_, _]` not covered
395
+
| ^^^^^^^^^^^ patterns `&[]`, `&[!]` and `&[!, !]` not covered
396
396
|
397
397
= note: the matched value is of type `&[!]`
398
398
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
399
399
|
400
400
LL ~ [_, _, _, ..] => {},
401
-
LL + &[] | &[_] | &[_, _] => todo!()
401
+
LL + &[] | &[!] | &[!, !] => todo!()
402
402
|
403
403
404
-
error[E0004]: non-exhaustive patterns: `&[]` and `&[_, ..]` not covered
404
+
error[E0004]: non-exhaustive patterns: `&[]` and `&[!, ..]` not covered
405
405
--> $DIR/empty-types.rs:352:11
406
406
|
407
407
LL | match slice_never {
408
-
| ^^^^^^^^^^^ patterns `&[]` and `&[_, ..]` not covered
408
+
| ^^^^^^^^^^^ patterns `&[]` and `&[!, ..]` not covered
409
409
|
410
410
= note: the matched value is of type `&[!]`
411
411
= note: match arms with guards don't count towards exhaustivity
412
412
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
413
413
|
414
414
LL ~ &[..] if false => {},
415
-
LL + &[] | &[_, ..] => todo!()
415
+
LL + &[] | &[!, ..] => todo!()
416
416
|
417
417
418
418
error[E0004]: non-exhaustive patterns: type `[!]` is non-empty
@@ -477,11 +477,11 @@ LL ~ [..] if false => {},
477
477
LL + [] => todo!()
478
478
|
479
479
480
-
error[E0004]: non-exhaustive patterns: `&Some(_)` not covered
480
+
error[E0004]: non-exhaustive patterns: `&Some(!)` not covered
481
481
--> $DIR/empty-types.rs:452:11
482
482
|
483
483
LL | match ref_opt_never {
484
-
| ^^^^^^^^^^^^^ pattern `&Some(_)` not covered
484
+
| ^^^^^^^^^^^^^ pattern `&Some(!)` not covered
485
485
|
486
486
note: `Option<!>` defined here
487
487
--> $SRC_DIR/core/src/option.rs:LL:COL
@@ -492,14 +492,14 @@ note: `Option<!>` defined here
492
492
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
493
493
|
494
494
LL ~ &None => {},
495
-
LL + &Some(_) => todo!()
495
+
LL + &Some(!) => todo!()
496
496
|
497
497
498
-
error[E0004]: non-exhaustive patterns: `Some(_)` not covered
498
+
error[E0004]: non-exhaustive patterns: `Some(!)` not covered
499
499
--> $DIR/empty-types.rs:493:11
500
500
|
501
501
LL | match *ref_opt_never {
502
-
| ^^^^^^^^^^^^^^ pattern `Some(_)` not covered
502
+
| ^^^^^^^^^^^^^^ pattern `Some(!)` not covered
503
503
|
504
504
note: `Option<!>` defined here
505
505
--> $SRC_DIR/core/src/option.rs:LL:COL
@@ -510,14 +510,14 @@ note: `Option<!>` defined here
510
510
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
511
511
|
512
512
LL ~ None => {},
513
-
LL + Some(_) => todo!()
513
+
LL + Some(!) => todo!()
514
514
|
515
515
516
-
error[E0004]: non-exhaustive patterns: `Err(_)` not covered
516
+
error[E0004]: non-exhaustive patterns: `Err(!)` not covered
517
517
--> $DIR/empty-types.rs:541:11
518
518
|
519
519
LL | match *ref_res_never {
520
-
| ^^^^^^^^^^^^^^ pattern `Err(_)` not covered
520
+
| ^^^^^^^^^^^^^^ pattern `Err(!)` not covered
521
521
|
522
522
note: `Result<!, !>` defined here
523
523
--> $SRC_DIR/core/src/result.rs:LL:COL
@@ -528,14 +528,14 @@ note: `Result<!, !>` defined here
528
528
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
529
529
|
530
530
LL ~ Ok(_) => {},
531
-
LL + Err(_) => todo!()
531
+
LL + Err(!) => todo!()
532
532
|
533
533
534
-
error[E0004]: non-exhaustive patterns: `Err(_)` not covered
534
+
error[E0004]: non-exhaustive patterns: `Err(!)` not covered
535
535
--> $DIR/empty-types.rs:552:11
536
536
|
537
537
LL | match *ref_res_never {
538
-
| ^^^^^^^^^^^^^^ pattern `Err(_)` not covered
538
+
| ^^^^^^^^^^^^^^ pattern `Err(!)` not covered
539
539
|
540
540
note: `Result<!, !>` defined here
541
541
--> $SRC_DIR/core/src/result.rs:LL:COL
@@ -546,7 +546,7 @@ note: `Result<!, !>` defined here
546
546
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
547
547
|
548
548
LL ~ Ok(_a) => {},
549
-
LL + Err(_) => todo!()
549
+
LL + Err(!) => todo!()
550
550
|
551
551
552
552
error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty
@@ -587,26 +587,26 @@ error: unreachable pattern
587
587
LL | _x if false => {}
588
588
| ^^
589
589
590
-
error[E0004]: non-exhaustive patterns: `&_` not covered
590
+
error[E0004]: non-exhaustive patterns: `&!` not covered
591
591
--> $DIR/empty-types.rs:638:11
592
592
|
593
593
LL | match ref_never {
594
-
| ^^^^^^^^^ pattern `&_` not covered
594
+
| ^^^^^^^^^ pattern `&!` not covered
595
595
|
596
596
= note: the matched value is of type `&!`
597
597
= note: references are always considered inhabited
598
598
= note: match arms with guards don't count towards exhaustivity
599
599
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
600
600
|
601
601
LL ~ &_a if false => {},
602
-
LL + &_ => todo!()
602
+
LL + &! => todo!()
603
603
|
604
604
605
-
error[E0004]: non-exhaustive patterns: `Ok(_)` not covered
605
+
error[E0004]: non-exhaustive patterns: `Ok(!)` not covered
606
606
--> $DIR/empty-types.rs:654:11
607
607
|
608
608
LL | match *ref_result_never {
609
-
| ^^^^^^^^^^^^^^^^^ pattern `Ok(_)` not covered
609
+
| ^^^^^^^^^^^^^^^^^ pattern `Ok(!)` not covered
610
610
|
611
611
note: `Result<!, !>` defined here
612
612
--> $SRC_DIR/core/src/result.rs:LL:COL
@@ -617,14 +617,14 @@ note: `Result<!, !>` defined here
617
617
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
618
618
|
619
619
LL ~ Err(_) => {},
620
-
LL + Ok(_) => todo!()
620
+
LL + Ok(!) => todo!()
621
621
|
622
622
623
-
error[E0004]: non-exhaustive patterns: `Some(_)` not covered
623
+
error[E0004]: non-exhaustive patterns: `Some(!)` not covered
624
624
--> $DIR/empty-types.rs:674:11
625
625
|
626
626
LL | match *x {
627
-
| ^^ pattern `Some(_)` not covered
627
+
| ^^ pattern `Some(!)` not covered
628
628
|
629
629
note: `Option<Result<!, !>>` defined here
630
630
--> $SRC_DIR/core/src/option.rs:LL:COL
@@ -635,7 +635,7 @@ note: `Option<Result<!, !>>` defined here
635
635
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
636
636
|
637
637
LL ~ None => {},
638
-
LL + Some(_) => todo!()
638
+
LL + Some(!) => todo!()
639
639
|
640
640
641
641
error: aborting due to 49 previous errors; 1 warning emitted
0 commit comments