-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit 6fe68f8
authored
Rollup merge of #127943 - compiler-errors:no-unsafe, r=spastorino
Don't allow unsafe statics outside of extern blocks
This PR fixes a regression where we allowed `unsafe static` items in top-level modules (i.e. outside of `unsafe extern` blocks).
It's harder IMO to integrate this into the `check_item_safety` function, so I opted to just put this check on the `static` item itself.
Beta version of this lives at #127944.
r? ```@oli-obk``` or ```@spastorino```File tree
6 files changed
+35
-2
lines changed- compiler/rustc_ast_passes
- src
- tests/ui/rust-2024
6 files changed
+35
-2
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
269 | 269 |
| |
270 | 270 |
| |
271 | 271 |
| |
272 | + | ||
273 | + | ||
274 | + | ||
272 | 275 |
| |
273 | 276 |
| |
274 | 277 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
438 | 438 |
| |
439 | 439 |
| |
440 | 440 |
| |
441 | + | ||
442 | + | ||
443 | + | ||
444 | + | ||
445 | + | ||
441 | 446 |
| |
442 | 447 |
| |
443 | 448 |
| |
| |||
1177 | 1182 |
| |
1178 | 1183 |
| |
1179 | 1184 |
| |
1185 | + | ||
1186 | + | ||
1187 | + | ||
1180 | 1188 |
| |
1181 | 1189 |
| |
1182 | 1190 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
224 | 224 |
| |
225 | 225 |
| |
226 | 226 |
| |
227 | + | ||
228 | + | ||
229 | + | ||
230 | + | ||
231 | + | ||
232 | + | ||
233 | + | ||
227 | 234 |
| |
228 | 235 |
| |
229 | 236 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
31 | - | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
32 | 38 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
28 | + | ||
29 | + | ||
30 | + | ||
28 | 31 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
31 | 37 |
| |
32 | 38 |
| |
33 | 39 |
| |
| |||
78 | 84 |
| |
79 | 85 |
| |
80 | 86 |
| |
81 | - | ||
87 | + | ||
82 | 88 |
| |
83 | 89 |
|
0 commit comments