]> git.lizzy.rs Git - rust.git/commitdiff
Add message before dumping alloc
authorDavid Cook <divergentdave@gmail.com>
Fri, 24 Apr 2020 01:00:09 +0000 (20:00 -0500)
committerDavid Cook <divergentdave@gmail.com>
Fri, 24 Apr 2020 01:00:09 +0000 (20:00 -0500)
src/diagnostics.rs

index 565db7b178a1d25793fa9ead4d4fdc40d13af851..e72232323ba28879a4eb57040ac359f29384753a 100644 (file)
@@ -118,7 +118,12 @@ pub fn report_error<'tcx, 'mir>(
     let result = report_msg(ecx, &format!("{}: {}", title, msg), msg, helps, true);
 
     if let UndefinedBehavior(UndefinedBehaviorInfo::InvalidUndefBytes(Some(ptr))) = e.kind {
+        eprintln!(
+            "Uninitialized read occurred at offset 0x{:x} into this allocation:",
+            ptr.offset.bytes(),
+        );
         ecx.memory.dump_alloc(ptr.alloc_id);
+        eprintln!();
     }
 
     result