Locate rustc binary similarly to codegen backend loading

This ensures that the failure cases for finding the codegen backend and
for finding the rustc binary are essentially the same, and since we
almost always will load the codegen backend, this is essentially meaning
that the rustc change is not a regression.
This commit is contained in:
Mark Rousskov
2019-09-09 21:01:41 -04:00
parent 87b0c9036f
commit 2fc32b9e72
8 changed files with 129 additions and 79 deletions

View File

@@ -248,7 +248,7 @@ fn run_test(
};
let output_file = outdir.path().join("rust_out");
let mut compiler = Command::new(std::env::current_exe().unwrap().with_file_name("rustc"));
let mut compiler = Command::new(rustc_interface::util::rustc_path().expect("found rustc"));
compiler.arg("--crate-type").arg("bin");
for cfg in &options.cfgs {
compiler.arg("--cfg").arg(&cfg);