From d50fee9fb2e66b4162fbf5496e5abb7d3f29129a Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Mon, 10 Apr 2023 07:57:55 -0400 Subject: [PATCH] rustup --- src/tools/miri/src/shims/panic.rs | 20 +++++++------------ .../tests/fail/terminate-terminator.stderr | 4 +++- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/tools/miri/src/shims/panic.rs b/src/tools/miri/src/shims/panic.rs index 2cca2f3f3914..18ae01a19f91 100644 --- a/src/tools/miri/src/shims/panic.rs +++ b/src/tools/miri/src/shims/panic.rs @@ -157,7 +157,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { &[catch_unwind.data.into(), payload.into()], None, // Directly return to caller of `try`. - StackPopCleanup::Goto { ret: Some(catch_unwind.ret), unwind: mir::UnwindAction::Continue }, + StackPopCleanup::Goto { + ret: Some(catch_unwind.ret), + unwind: mir::UnwindAction::Continue, + }, )?; // We pushed a new stack frame, the engine should not do any jumping now! @@ -211,10 +214,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { Abi::Rust, &[index.into(), len.into()], None, - StackPopCleanup::Goto { - ret: None, - unwind, - }, + StackPopCleanup::Goto { ret: None, unwind }, )?; } MisalignedPointerDereference { required, found } => { @@ -235,19 +235,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { Abi::Rust, &[required.into(), found.into()], None, - StackPopCleanup::Goto { - ret: None, - unwind, - }, + StackPopCleanup::Goto { ret: None, unwind }, )?; } _ => { // Forward everything else to `panic` lang item. - this.start_panic( - msg.description(), - unwind, - )?; + this.start_panic(msg.description(), unwind)?; } } Ok(()) diff --git a/src/tools/miri/tests/fail/terminate-terminator.stderr b/src/tools/miri/tests/fail/terminate-terminator.stderr index 3befd83007bf..c046678f73f5 100644 --- a/src/tools/miri/tests/fail/terminate-terminator.stderr +++ b/src/tools/miri/tests/fail/terminate-terminator.stderr @@ -1,3 +1,5 @@ +warning: You have explicitly enabled MIR optimizations, overriding Miri's default which is to completely disable them. Any optimizations may hide UB that Miri would otherwise detect, and it is not necessarily possible to predict what kind of UB will be missed. If you are enabling optimizations to make Miri run faster, we advise using cfg(miri) to shrink your workload instead. The performance benefit of enabling MIR optimizations is usually marginal at best. + thread 'main' panicked at 'explicit panic', $DIR/terminate-terminator.rs:LL:CC note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: abnormal termination: panic in a function that cannot unwind @@ -23,5 +25,5 @@ LL | panic_abort(); note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace -error: aborting due to previous error +error: aborting due to previous error; 1 warning emitted