From df9d481989dee1dcbe9a3f886dcbb030deb2144b Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 25 Jul 2021 14:19:57 +0200 Subject: [PATCH] tell users how to disable the leak check --- src/eval.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/eval.rs b/src/eval.rs index 9531a2d78aba..e559dfedf933 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -302,7 +302,10 @@ pub fn eval_main<'tcx>(tcx: TyCtxt<'tcx>, main_id: DefId, config: MiriConfig) -> if !ignore_leaks { // Check for thread leaks. if !ecx.have_all_terminated() { - tcx.sess.err("the main thread terminated without waiting for all remaining threads"); + tcx.sess.err( + "the main thread terminated without waiting for all remaining threads", + ); + tcx.sess.note_without_error("pass `-Zmiri-ignore-leaks` to disable this check"); return None; } // Check for memory leaks. @@ -310,6 +313,7 @@ pub fn eval_main<'tcx>(tcx: TyCtxt<'tcx>, main_id: DefId, config: MiriConfig) -> let leaks = ecx.memory.leak_report(&ecx.machine.static_roots); if leaks != 0 { tcx.sess.err("the evaluated program leaked memory"); + tcx.sess.note_without_error("pass `-Zmiri-ignore-leaks` to disable this check"); // Ignore the provided return code - let the reported error // determine the return code. return None;