Skip to content

Commit d50fee9

Browse files
committed
rustup
1 parent 73702d5 commit d50fee9

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/tools/miri/src/shims/panic.rs

+7-13
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
157157
&[catch_unwind.data.into(), payload.into()],
158158
None,
159159
// Directly return to caller of `try`.
160-
StackPopCleanup::Goto { ret: Some(catch_unwind.ret), unwind: mir::UnwindAction::Continue },
160+
StackPopCleanup::Goto {
161+
ret: Some(catch_unwind.ret),
162+
unwind: mir::UnwindAction::Continue,
163+
},
161164
)?;
162165

163166
// 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> {
211214
Abi::Rust,
212215
&[index.into(), len.into()],
213216
None,
214-
StackPopCleanup::Goto {
215-
ret: None,
216-
unwind,
217-
},
217+
StackPopCleanup::Goto { ret: None, unwind },
218218
)?;
219219
}
220220
MisalignedPointerDereference { required, found } => {
@@ -235,19 +235,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
235235
Abi::Rust,
236236
&[required.into(), found.into()],
237237
None,
238-
StackPopCleanup::Goto {
239-
ret: None,
240-
unwind,
241-
},
238+
StackPopCleanup::Goto { ret: None, unwind },
242239
)?;
243240
}
244241

245242
_ => {
246243
// Forward everything else to `panic` lang item.
247-
this.start_panic(
248-
msg.description(),
249-
unwind,
250-
)?;
244+
this.start_panic(msg.description(), unwind)?;
251245
}
252246
}
253247
Ok(())

src/tools/miri/tests/fail/terminate-terminator.stderr

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
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.
2+
13
thread 'main' panicked at 'explicit panic', $DIR/terminate-terminator.rs:LL:CC
24
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
35
error: abnormal termination: panic in a function that cannot unwind
@@ -23,5 +25,5 @@ LL | panic_abort();
2325

2426
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
2527

26-
error: aborting due to previous error
28+
error: aborting due to previous error; 1 warning emitted
2729

0 commit comments

Comments
 (0)