-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add unstable env::set and env::remove #92431
Conversation
r? @kennytm (rust-highfive has picked a reviewer for you, use r? to override) |
f5455df
to
cae3faf
Compare
cae3faf
to
875449f
Compare
875449f
to
c40ec5a
Compare
/// This function must not be called in the presence of concurrent threads that | ||
/// may simultaneously read or write the environment. Also, it's not allowed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be noted that this isn't the case on Windows.
The libs-api team discussed this at last weeks' meeting. There were a couple concerns with this PR as-is:
To that effect, the next steps in this space are (roughly):
Would you be interested in helping to drive the first step here? I believe there may already be some design discussions (or PRs) open. Otherwise, I plan to invest in the coming week(s) in pushing this plan forward. |
I think I like the idea of As far dotenv::dotenv().ok();
env_logger::init(); This works because |
I think it makes sense to have an alternative to
set_var
andremove_var
on nightly that is actually unsafe. Name of this function needs bike-shedding, but I imagine this could be done during stabilization. See https://internals.rust-lang.org/t/synchronized-ffi-access-to-posix-environment-variable-functions/15475?u=xfix for context.