I'll +1 @josh re: somewhat strong opposition to a "shadow environment". It is not a zero cost abstraction, and from a security perspective might give the impression that secrets (which really shouldn't be kept in environment variables, but that ship has sailed and I digress) have been removed from the environment when they have only been removed from the shadow environment, not the process environment. This has turned into something of a debacle with Java.
Based on some informal surveys done earlier in this thread of in-the-wild Rust code, it really seems like the main motivations for set_var
are effectively missing APIs in Rust itself, where instead of having a first-class API to do something, environment variables are used instead.
I agree and think we do need to give people something to migrate to, but I think a better solution is mapping out those required APIs and providing a migration document.