miri/diagnostics: don't forget to print_backtrace when ICEing on unexpected errors

then also use the new helper in a few other places
This commit is contained in:
Ralf Jung
2023-08-27 14:41:35 +02:00
parent b60f7b51a2
commit beeb2b13cc
5 changed files with 57 additions and 44 deletions

View File

@@ -911,9 +911,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
// Complain about any other kind of error -- those are bad because we'd like to
// report them in a way that shows *where* in the value the issue lies.
Err(err) => {
let (err, backtrace) = err.into_parts();
backtrace.print_backtrace();
bug!("Unexpected Undefined Behavior error during validation: {err:?}");
bug!(
"Unexpected Undefined Behavior error during validation: {}",
self.format_error(err)
);
}
}
}