Skip to content

Commit

Permalink
Auto merge of #5985 - dwijnand:fix-rustc-wrapper-unset, r=alexcrichton
Browse files Browse the repository at this point in the history
Don't use an empty RUSTC_WRAPPER

Fixes #5588
  • Loading branch information
bors committed Sep 6, 2018
2 parents b15ee25 + 9b67b27 commit 7afa449
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/cargo/util/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ impl Rustc {

/// Get a process builder set up to use the found rustc version, with a wrapper if Some
pub fn process(&self) -> ProcessBuilder {
if let Some(ref wrapper) = self.wrapper {
let mut cmd = util::process(wrapper);
cmd.arg(&self.path);
cmd
} else {
self.process_no_wrapper()
match self.wrapper {
Some(ref wrapper) if !wrapper.as_os_str().is_empty() => {
let mut cmd = util::process(wrapper);
cmd.arg(&self.path);
cmd
}
_ => self.process_no_wrapper()
}
}

Expand Down
6 changes: 6 additions & 0 deletions tests/testsuite/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,3 +684,9 @@ fn proc_macro() {
).build();
p.cargo("check -v").env("RUST_LOG", "cargo=trace").run();
}

#[test]
fn does_not_use_empty_rustc_wrapper() {
let p = project().file("src/lib.rs", "").build();
p.cargo("check").env("RUSTC_WRAPPER", "").run();
}

0 comments on commit 7afa449

Please sign in to comment.