Don't allow unsafe statics outside of extern blocks (beta version)#127944
Merged
bors merged 1 commit intorust-lang:betafrom Jul 19, 2024
Merged
Don't allow unsafe statics outside of extern blocks (beta version)#127944bors merged 1 commit intorust-lang:betafrom
bors merged 1 commit intorust-lang:betafrom
Conversation
Collaborator
Collaborator
|
Contributor
Author
|
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 😸 ❤️ |
wesleywiser
approved these changes
Jul 18, 2024
Member
|
I think we should definitely backport this, so consider this |
Member
|
@bors r+ rollup=never p=5 |
Collaborator
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jul 19, 2024
…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`
Collaborator
tgross35
added a commit
to tgross35/rust
that referenced
this pull request
Jul 19, 2024
…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``
Collaborator
|
☀️ Test successful - checks-actions |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jul 19, 2024
…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```
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 19, 2024
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a regression where we allowed
unsafe staticitems in top-level modules (i.e. outside ofunsafe externblocks).#127943 does not rebase cleanly, so I've prepared an extremely pared down version of this PR for beta purposes.