-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't allow unsafe statics outside of extern blocks (beta version) #127944
Conversation
|
Please don't r+ unless release is ok w/ this. Apologies for the ad-hoc nature of this change, but the other PR doesn't rebase well at all. Do please r+ the other version (#127943), though 😸 ❤️ |
I think we should definitely backport this, so consider this |
@bors r+ rollup=never p=5 |
…orino 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 rust-lang#127944. r? `@oli-obk` or `@spastorino`
…orino 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 rust-lang#127944. r? ``@oli-obk`` or ``@spastorino``
☀️ Test successful - checks-actions |
…orino 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 rust-lang#127944. r? ```@oli-obk``` or ```@spastorino```
Rollup merge of rust-lang#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 rust-lang#127944. r? ```@oli-obk``` or ```@spastorino```
This PR fixes a regression where we allowed
unsafe static
items in top-level modules (i.e. outside ofunsafe extern
blocks).#127943 does not rebase cleanly, so I've prepared an extremely pared down version of this PR for beta purposes.