File tree 2 files changed +10
-6
lines changed
src/tools/miri/cargo-miri/src
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,12 @@ pub fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
89
89
let verbose = num_arg_flag ( "-v" ) ;
90
90
91
91
// Determine the involved architectures.
92
- let rustc_version = VersionMeta :: for_command ( miri_for_host ( ) )
93
- . expect ( "failed to determine underlying rustc version of Miri" ) ;
92
+ let rustc_version = VersionMeta :: for_command ( miri_for_host ( ) ) . unwrap_or_else ( |err| {
93
+ panic ! (
94
+ "failed to determine underlying rustc version of Miri ({:?}):\n {err:?}" ,
95
+ miri_for_host( )
96
+ )
97
+ } ) ;
94
98
let host = & rustc_version. host ;
95
99
let target = get_arg_flag_value ( "--target" ) ;
96
100
let target = target. as_ref ( ) . unwrap_or ( host) ;
@@ -213,7 +217,7 @@ pub fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
213
217
}
214
218
215
219
// Run cargo.
216
- debug_cmd ( "[cargo-miri miri ]" , verbose, & cmd) ;
220
+ debug_cmd ( "[cargo-miri cargo ]" , verbose, & cmd) ;
217
221
exec ( cmd)
218
222
}
219
223
Original file line number Diff line number Diff line change @@ -90,13 +90,13 @@ pub fn setup(
90
90
let cargo_cmd = {
91
91
let mut command = cargo ( ) ;
92
92
// Use Miri as rustc to build a libstd compatible with us (and use the right flags).
93
+ // We set ourselves (`cargo-miri`) instead of Miri directly to be able to patch the flags
94
+ // for `libpanic_abort` (usually this is done by bootstrap but we have to do it ourselves).
95
+ // The `MIRI_CALLED_FROM_SETUP` will mean we dispatch to `phase_setup_rustc`.
93
96
// However, when we are running in bootstrap, we cannot just overwrite `RUSTC`,
94
97
// because we still need bootstrap to distinguish between host and target crates.
95
98
// In that case we overwrite `RUSTC_REAL` instead which determines the rustc used
96
99
// for target crates.
97
- // We set ourselves (`cargo-miri`) instead of Miri directly to be able to patch the flags
98
- // for `libpanic_abort` (usually this is done by bootstrap but we have to do it ourselves).
99
- // The `MIRI_CALLED_FROM_SETUP` will mean we dispatch to `phase_setup_rustc`.
100
100
let cargo_miri_path = std:: env:: current_exe ( ) . expect ( "current executable path invalid" ) ;
101
101
if env:: var_os ( "RUSTC_STAGE" ) . is_some ( ) {
102
102
assert ! ( env:: var_os( "RUSTC" ) . is_some( ) ) ;
You can’t perform that action at this time.
0 commit comments