diff --git a/src/diagnostics.rs b/src/diagnostics.rs index e72232323ba..114f1d9be36 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! {