Skip to content

Commit 45ed82d

Browse files
committed
Update warning message in warning-nobacktrace mode
1 parent 8756a2f commit 45ed82d

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

src/helpers.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
404404
match reject_with {
405405
RejectOpWith::Abort => isolation_abort_error(op_name),
406406
RejectOpWith::WarningWithoutBacktrace => {
407-
let msg = format!("`{}` was made to return an error due to isolation", op_name);
408-
let mut warn = this.tcx.sess.struct_warn(&msg);
409-
warn.note("run with -Zmiri-isolation-error=warn to get warning with a backtrace");
410-
warn.note("run with -Zmiri-isolation-error=ignore to hide warning");
411-
warn.note("run with -Zmiri-disable-isolation to disable isolation");
412-
warn.emit();
407+
this.tcx.sess.warn(&format!("`{}` was made to return an error due to isolation", op_name));
413408
Ok(())
414409
}
415410
RejectOpWith::Warning => {

tests/run-pass/current_dir_with_isolation.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// compile-flags: -Zmiri-isolation-error=warn-nobacktrace
2+
// normalize-stderr-test "(getcwd|GetCurrentDirectoryW)" -> "$$GET"
3+
// normalize-stderr-test "(chdir|SetCurrentDirectoryW)" -> "$$SET"
4+
25
use std::env;
36
use std::io::ErrorKind;
47

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
warning: `getcwd` was made to return an error due to isolation
2-
|
3-
= note: run with -Zmiri-isolation-error=warn to get warning with a backtrace
4-
= note: run with -Zmiri-isolation-error=ignore to hide warning
5-
= note: run with -Zmiri-disable-isolation to disable isolation
1+
warning: `$GET` was made to return an error due to isolation
62

7-
warning: `chdir` was made to return an error due to isolation
8-
|
9-
= note: run with -Zmiri-isolation-error=warn to get warning with a backtrace
10-
= note: run with -Zmiri-isolation-error=ignore to hide warning
11-
= note: run with -Zmiri-disable-isolation to disable isolation
3+
warning: `$SET` was made to return an error due to isolation
124

0 commit comments

Comments
 (0)