Skip to content

Commit

Permalink
Merge pull request #4 from dtolnay-contrib/rustcwrapper
Browse files Browse the repository at this point in the history
Invoke the rust compiler for the appropriate tool chain
  • Loading branch information
hermanventer authored Oct 18, 2024
2 parents 78e7f87 + 7f9f044 commit 197430e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions checker/src/cargo_mirai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,14 @@ fn call_mirai() {
}

fn call_rustc() {
// todo: invoke the rust compiler for the appropriate tool chain?
let mut cmd =
Command::new(std::env::var_os("RUSTC").unwrap_or_else(|| OsString::from("rustc")));
cmd.args(std::env::args().skip(2));
let mut args = std::env::args_os().skip(1);
// The rustc to use is passed by Cargo as the first argument to RUSTC_WRAPPER
let mut cmd = Command::new(
args.next()
.or_else(|| std::env::var_os("RUSTC"))
.unwrap_or_else(|| OsString::from("rustc")),
);
cmd.args(args);
let exit_status = cmd
.spawn()
.expect("could not run rustc")
Expand Down

0 comments on commit 197430e

Please sign in to comment.