Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
divergentdave committed Apr 27, 2020
1 parent 7f92eab commit e267fb4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:",
Expand All @@ -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.
Expand All @@ -137,7 +138,7 @@ fn report_msg<'tcx, 'mir>(
span_msg: String,
mut helps: Vec<String>,
error: bool,
) -> Option<i64> {
) {
let span = if let Some(frame) = ecx.machine.stack.last() {
frame.current_source_info().unwrap().span
} else {
Expand Down Expand Up @@ -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! {
Expand Down

0 comments on commit e267fb4

Please sign in to comment.