Add unstable env::set and env::remove - #92431
Conversation
|
r? @kennytm (rust-highfive has picked a reviewer for you, use r? to override) |
| /// 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.
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_varandremove_varon 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.