Skip to content

Commit ac454a2

Browse files
committed
cargo-miri: allow overwriting miri command, and make that consistent with compiletest
1 parent 35964b1 commit ac454a2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

cargo-miri/bin.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ fn get_arg_flag_value(name: &str) -> Option<String> {
9494

9595
/// Returns the path to the `miri` binary
9696
fn find_miri() -> PathBuf {
97+
if let Some(path) = env::var_os("MIRI") {
98+
return path.into();
99+
}
97100
let mut path = std::env::current_exe().expect("current executable path invalid");
98101
path.set_file_name("miri");
99102
path

tests/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use colored::*;
99
use compiletest_rs as compiletest;
1010

1111
fn miri_path() -> PathBuf {
12-
PathBuf::from(option_env!("MIRI_PATH").unwrap_or(env!("CARGO_BIN_EXE_miri")))
12+
PathBuf::from(option_env!("MIRI").unwrap_or(env!("CARGO_BIN_EXE_miri")))
1313
}
1414

1515
fn run_tests(mode: &str, path: &str, target: &str) {

0 commit comments

Comments
 (0)