Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit c666342

Browse files
committed
use RUSTC environment var in parse_and_replace::compile if present
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).
1 parent ef816e0 commit c666342

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/parse_and_replace.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ extern crate difference;
1313

1414
use std::collections::HashSet;
1515
use std::ffi::OsString;
16+
use std::env;
1617
use std::fs;
1718
use std::path::{Path, PathBuf};
1819
use std::process::Output;
@@ -51,7 +52,7 @@ fn compile(file: &Path, mode: &str) -> Result<Output, Error> {
5152
args.push("--edition=2018".into());
5253
}
5354

54-
let res = duct::cmd("rustc", &args)
55+
let res = duct::cmd(env::var_os("RUSTC").unwrap_or("rustc".into()), &args)
5556
.env("CLIPPY_DISABLE_DOCS_LINKS", "true")
5657
.env_remove("RUST_LOG")
5758
.stdout_capture()

0 commit comments

Comments
 (0)