Commit af9fe58
committed
Account for non-exhausitve match expression coming from macro expansion
```
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
--> $DIR/exhaustiveness.rs:47:8
|
LL | m!(0u8, 0..255);
| ^^^ pattern `u8::MAX` not covered
|
= note: the matched value is of type `u8`
note: within macro `m`, this `match` expression doesn't expand to cover all patterns
--> $DIR/exhaustiveness.rs:7:9
|
LL | / macro_rules! m {
LL | | ($s:expr, $($t:tt)+) => {
LL | | match $s { $($t)+ => {} }
| | ^^^^^^^^^^^^^^^^^^^^^^^^^
LL | | }
LL | | }
| |_-
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern
```1 parent e4efdce commit af9fe58
File tree
7 files changed
+1519
-537
lines changed- compiler/rustc_mir_build/src/thir/pattern
- tests/ui
- half-open-range-patterns
- pattern/usefulness
- integer-ranges
7 files changed
+1519
-537
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
| 546 | + | |
546 | 547 | | |
547 | 548 | | |
548 | 549 | | |
| |||
1214 | 1215 | | |
1215 | 1216 | | |
1216 | 1217 | | |
| 1218 | + | |
1217 | 1219 | | |
1218 | 1220 | | |
1219 | 1221 | | |
| |||
1354 | 1356 | | |
1355 | 1357 | | |
1356 | 1358 | | |
1357 | | - | |
| 1359 | + | |
1358 | 1360 | | |
1359 | 1361 | | |
1360 | 1362 | | |
1361 | | - | |
1362 | 1363 | | |
1363 | 1364 | | |
1364 | 1365 | | |
| |||
1387 | 1388 | | |
1388 | 1389 | | |
1389 | 1390 | | |
1390 | | - | |
| 1391 | + | |
1391 | 1392 | | |
1392 | 1393 | | |
1393 | 1394 | | |
| |||
1422 | 1423 | | |
1423 | 1424 | | |
1424 | 1425 | | |
1425 | | - | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
1426 | 1445 | | |
1427 | 1446 | | |
1428 | 1447 | | |
| |||
0 commit comments