Skip to content

Commit df9d481

Browse files
committed
tell users how to disable the leak check
1 parent 71efd95 commit df9d481

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/eval.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,18 @@ pub fn eval_main<'tcx>(tcx: TyCtxt<'tcx>, main_id: DefId, config: MiriConfig) ->
302302
if !ignore_leaks {
303303
// Check for thread leaks.
304304
if !ecx.have_all_terminated() {
305-
tcx.sess.err("the main thread terminated without waiting for all remaining threads");
305+
tcx.sess.err(
306+
"the main thread terminated without waiting for all remaining threads",
307+
);
308+
tcx.sess.note_without_error("pass `-Zmiri-ignore-leaks` to disable this check");
306309
return None;
307310
}
308311
// Check for memory leaks.
309312
info!("Additonal static roots: {:?}", ecx.machine.static_roots);
310313
let leaks = ecx.memory.leak_report(&ecx.machine.static_roots);
311314
if leaks != 0 {
312315
tcx.sess.err("the evaluated program leaked memory");
316+
tcx.sess.note_without_error("pass `-Zmiri-ignore-leaks` to disable this check");
313317
// Ignore the provided return code - let the reported error
314318
// determine the return code.
315319
return None;

0 commit comments

Comments
 (0)