]> git.lizzy.rs Git - rust.git/commitdiff
Reorder output
authorDavid Cook <divergentdave@gmail.com>
Wed, 22 Apr 2020 22:41:06 +0000 (17:41 -0500)
committerDavid Cook <divergentdave@gmail.com>
Wed, 22 Apr 2020 22:44:12 +0000 (17:44 -0500)
src/diagnostics.rs

index 77aaacea02400cc5b25602df1ad4ad7360ac8f9b..565db7b178a1d25793fa9ead4d4fdc40d13af851 100644 (file)
@@ -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.