Skip to content

Commit

Permalink
use RUSTC environment var in parse_and_replace::compile if present
Browse files Browse the repository at this point in the history
Cargo respects this environment variable (to specify the path to what
rustc binary to use), but the Rustfix test suite did not. However,
this capability is useful when developing new compiler diagnostics
that one wants Rustfix to be able to handle (this being inspired by
work on the endeavor that is rust-lang/rust#53013).
  • Loading branch information
zackmdavis committed Aug 20, 2018
1 parent ef816e0 commit c666342
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/parse_and_replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ extern crate difference;

use std::collections::HashSet;
use std::ffi::OsString;
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use std::process::Output;
Expand Down Expand Up @@ -51,7 +52,7 @@ fn compile(file: &Path, mode: &str) -> Result<Output, Error> {
args.push("--edition=2018".into());
}

let res = duct::cmd("rustc", &args)
let res = duct::cmd(env::var_os("RUSTC").unwrap_or("rustc".into()), &args)
.env("CLIPPY_DISABLE_DOCS_LINKS", "true")
.env_remove("RUST_LOG")
.stdout_capture()
Expand Down

0 comments on commit c666342

Please sign in to comment.