Commit 2f56207
committed
Auto merge of #38776 - eddyb:unsigned-means-unsigned, r=pnkfelix
Properly ban the negation of unsigned integers in type-checking.
Lint-time banning of unsigned negation appears to be vestigial from a time it was feature-gated.
But now it always errors and we do have the ability to deref the checking of e.g. `-0`, through the trait obligation fulfillment context, which will only succeed/error when the `0` gets inferred to a specific type.
The two removed tests are the main reason for finally cleaning this up, they need changing all the time when refactoring the HIR-based `rustc_const_eval` and/or `rustc_passes::consts`, as warnings pile up.File tree
7 files changed
+28
-203
lines changed- src
- librustc_lint
- librustc_typeck/check
- test/compile-fail
7 files changed
+28
-203
lines changed- src/dox.rs+38
- src/unix/bsd/apple/mod.rs+2
- src/unix/mod.rs+6
- src/unix/notbsd/android/mod.rs+28-1
- src/unix/notbsd/linux/mips/mod.rs+34
- src/unix/notbsd/linux/mod.rs+129-13
- src/unix/notbsd/linux/musl/mod.rs+34
- src/unix/notbsd/linux/other/b32/mod.rs+195
- src/unix/notbsd/linux/other/b64/aarch64.rs+197
- src/unix/notbsd/linux/other/b64/mod.rs-4
- src/unix/notbsd/linux/other/b64/powerpc64.rs+197
- src/unix/notbsd/linux/other/b64/sparc64.rs+191
- src/unix/notbsd/linux/other/b64/x86_64.rs+197
- src/unix/notbsd/linux/other/mod.rs+12-585
- src/unix/notbsd/linux/s390x.rs+34
- src/unix/notbsd/mod.rs+1-92
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 38 | | |
65 | 39 | | |
66 | 40 | | |
| |||
109 | 83 | | |
110 | 84 | | |
111 | 85 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | 86 | | |
131 | 87 | | |
132 | 88 | | |
| |||
369 | 325 | | |
370 | 326 | | |
371 | 327 | | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | 328 | | |
380 | 329 | | |
381 | 330 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3552 | 3552 | | |
3553 | 3553 | | |
3554 | 3554 | | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
| 3558 | + | |
3555 | 3559 | | |
3556 | | - | |
3557 | | - | |
3558 | | - | |
| 3560 | + | |
3559 | 3561 | | |
3560 | 3562 | | |
3561 | 3563 | | |
3562 | 3564 | | |
3563 | 3565 | | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
3564 | 3570 | | |
3565 | | - | |
3566 | | - | |
3567 | | - | |
| 3571 | + | |
3568 | 3572 | | |
3569 | 3573 | | |
3570 | 3574 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
128 | 137 | | |
129 | 138 | | |
130 | 139 | | |
| |||
185 | 194 | | |
186 | 195 | | |
187 | 196 | | |
188 | | - | |
| 197 | + | |
189 | 198 | | |
190 | 199 | | |
191 | 200 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
27 | 23 | | |
28 | | - | |
29 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
30 | 27 | | |
31 | 28 | | |
This file was deleted.
0 commit comments