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
Make std::env::{set_var, remove_var}
unsafe in edition 2024
#124636
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt Some changes occurred in src/tools/compiletest cc @jieyouxu The Miri subtree was changed cc @rust-lang/miri |
This comment has been minimized.
This comment has been minimized.
Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt The Miri subtree was changed cc @rust-lang/miri Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in src/tools/compiletest cc @jieyouxu |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Should there be a warning on older editions, to make this not come entirely out of the blue when doing edition migration? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I agree that this would be quite useful. It seems hard to do right now, though, because a stage 0 compiler will detect a lot of unused |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I wasn't talking about unused_unsafe, but a lint that warns against using set_var/remove_var outside an unsafe block on old editions. Also, I am not sure if it's the best idea to add new lang items for these functions. In the past the proposal was to add an attribute for "deprecating safety". Then we could e.g. also add that attribute to before_exec. |
FCP for making these functions @rfcbot fcp merge |
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
@Amanieu shouldn't this be a libs-API FCP? |
Yes, it should. @rfcbot cancel |
@Amanieu proposal cancelled. |
@rfcbot merge |
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Allow calling these functions without
unsafe
blocks in editions up until 2021, but don't trigger theunused_unsafe
lint forunsafe
blocks containing these functions.Fixes #27970.
Fixes #90308.
CC #124866.