Skip to content

Commit e32c184

Browse files
Rollup merge of rust-lang#124116 - RalfJung:miri-rust-backtrace, r=Nilstrieb
when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation Fixes rust-lang/miri#2855
2 parents 63a6950 + b079821 commit e32c184

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

std/src/panicking.rs

+7
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,13 @@ fn default_hook(info: &PanicInfo<'_>) {
277277
"note: run with `RUST_BACKTRACE=1` environment variable to display a \
278278
backtrace"
279279
);
280+
if cfg!(miri) {
281+
let _ = writeln!(
282+
err,
283+
"note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` \
284+
for the environment variable to have an effect"
285+
);
286+
}
280287
}
281288
}
282289
// If backtraces aren't supported or are forced-off, do nothing.

0 commit comments

Comments
 (0)