Commit 9f06fbd
authored
Rollup merge of rust-lang#103402 - joshtriplett:niche-wrap-fix, r=oli-obk
Fix wrapped valid-range handling in ty_find_init_error
Rust's niche handling allows for wrapping valid ranges with end < start;
for instance, a valid range with start=43 and end=41 means a niche of
42. Most places in the compiler handle this correctly, but
`ty_find_init_error` assumed that `lo > 0` means the type cannot contain a
zero.
Fix it to handle wrapping ranges.File tree
3 files changed
+73
-52
lines changed- compiler/rustc_lint/src
- src/test/ui/lint
3 files changed
+73
-52
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2526 | 2526 | | |
2527 | 2527 | | |
2528 | 2528 | | |
2529 | | - | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
2530 | 2533 | | |
2531 | 2534 | | |
2532 | 2535 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
134 | 141 | | |
135 | 142 | | |
136 | 143 | | |
| |||
0 commit comments