From e267fb4edec86c84b6c0e415a647ba9f8b9f0c9e Mon Sep 17 00:00:00 2001 From: David Cook Date: Sun, 26 Apr 2020 22:13:36 -0500 Subject: [PATCH] Review comments --- src/diagnostics.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/diagnostics.rs b/src/diagnostics.rs index e72232323b..114f1d9be3 100644 --- a/src/diagnostics.rs +++ b/src/diagnostics.rs @@ -115,8 +115,9 @@ 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); + report_msg(ecx, &format!("{}: {}", title, msg), msg, helps, true); + // Extra output to help debug specific issues. if let UndefinedBehavior(UndefinedBehaviorInfo::InvalidUndefBytes(Some(ptr))) = e.kind { eprintln!( "Uninitialized read occurred at offset 0x{:x} into this allocation:", @@ -126,7 +127,7 @@ pub fn report_error<'tcx, 'mir>( eprintln!(); } - result + None } /// Report an error or note (depending on the `error` argument) at the current frame's current statement. @@ -137,7 +138,7 @@ fn report_msg<'tcx, 'mir>( span_msg: String, mut helps: Vec, error: bool, -) -> Option { +) { let span = if let Some(frame) = ecx.machine.stack.last() { frame.current_source_info().unwrap().span } else { @@ -178,8 +179,6 @@ fn report_msg<'tcx, 'mir>( trace!(" local {}: {:?}", i, local.value); } } - // Let the reported error determine the return code. - return None; } thread_local! {