Auto merge of #118830 - GuillaumeGomez:env-tracked_env, r=Nilstrieb

Add support for `--env` on `tracked_env::var`

Follow-up of https://github.com/rust-lang/rust/pull/118368.
Part of Part of https://github.com/rust-lang/rust/issues/80792.

It adds support of the `--env` option for proc-macros through `tracked_env::var`.

r? `@Nilstrieb`
This commit is contained in:
bors 2023-12-17 04:23:08 +00:00
commit 5e7025419d
6 changed files with 56 additions and 1 deletions

View file

@ -426,6 +426,10 @@ impl server::Types for Rustc<'_, '_> {
}
impl server::FreeFunctions for Rustc<'_, '_> {
fn injected_env_var(&mut self, var: &str) -> Option<String> {
self.ecx.sess.opts.logical_env.get(var).cloned()
}
fn track_env_var(&mut self, var: &str, value: Option<&str>) {
self.sess()
.env_depinfo