Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}