diff options
| author | The Miri Cronjob Bot <miri@cron.bot> | 2025-01-26 05:11:44 +0000 |
|---|---|---|
| committer | The Miri Cronjob Bot <miri@cron.bot> | 2025-01-26 05:11:44 +0000 |
| commit | 06db6bba3b6f9853d692cc20ade7fbc121e27573 (patch) | |
| tree | e52f559fa38a8bb7c6f1d26ef966b9884f7892d9 /compiler/rustc_codegen_ssa/src/back/command.rs | |
| parent | 7209ae6dd021747401f6228318a10c8e7708efa0 (diff) | |
| parent | 2f0ad2a71e4a4528bb80bcb24bf8fa4e50cb87c2 (diff) | |
| download | rust-06db6bba3b6f9853d692cc20ade7fbc121e27573.tar.gz rust-06db6bba3b6f9853d692cc20ade7fbc121e27573.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back/command.rs')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/command.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/command.rs b/compiler/rustc_codegen_ssa/src/back/command.rs index b3c5b86ccf4..63023fdba20 100644 --- a/compiler/rustc_codegen_ssa/src/back/command.rs +++ b/compiler/rustc_codegen_ssa/src/back/command.rs @@ -13,6 +13,7 @@ pub(crate) struct Command { args: Vec<OsString>, env: Vec<(OsString, OsString)>, env_remove: Vec<OsString>, + env_clear: bool, } #[derive(Clone)] @@ -36,7 +37,13 @@ impl Command { } fn _new(program: Program) -> Command { - Command { program, args: Vec::new(), env: Vec::new(), env_remove: Vec::new() } + Command { + program, + args: Vec::new(), + env: Vec::new(), + env_remove: Vec::new(), + env_clear: false, + } } pub(crate) fn arg<P: AsRef<OsStr>>(&mut self, arg: P) -> &mut Command { @@ -79,6 +86,11 @@ impl Command { self } + pub(crate) fn env_clear(&mut self) -> &mut Command { + self.env_clear = true; + self + } + fn _env_remove(&mut self, key: &OsStr) { self.env_remove.push(key.to_owned()); } @@ -106,6 +118,9 @@ impl Command { for k in &self.env_remove { ret.env_remove(k); } + if self.env_clear { + ret.env_clear(); + } ret } |
