From 9057dae235df4d893b3051991e9794af15b32902 Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 22 Apr 2020 17:41:06 -0500 Subject: [PATCH] Reorder output --- src/diagnostics.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/diagnostics.rs b/src/diagnostics.rs index 77aaacea024..565db7b178a 100644 --- a/src/diagnostics.rs +++ b/src/diagnostics.rs @@ -114,11 +114,14 @@ pub fn report_error<'tcx, 'mir>( }; e.print_backtrace(); + let msg = e.to_string(); + let result = report_msg(ecx, &format!("{}: {}", title, msg), msg, helps, true); + if let UndefinedBehavior(UndefinedBehaviorInfo::InvalidUndefBytes(Some(ptr))) = e.kind { ecx.memory.dump_alloc(ptr.alloc_id); } - let msg = e.to_string(); - report_msg(ecx, &format!("{}: {}", title, msg), msg, helps, true) + + result } /// Report an error or note (depending on the `error` argument) at the current frame's current statement. -- 2.44.0