Skip to content

Commit 5b3d265

Browse files
committed
Auto merge of #1223 - RalfJung:rustup, r=RalfJung
rustup, test Abort terminator
2 parents 0f22d8a + 5531a79 commit 5b3d265

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c20d7eecbc0928b57da8fe30b2ef8528e2bdd5be
1+
54b7d21f59a363e53eb1c31d76b40af2ff99321c

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![feature(rustc_private)]
22
#![feature(option_expect_none, option_unwrap_none)]
33
#![feature(map_first_last)]
4+
#![feature(never_type)]
45
#![warn(rust_2018_idioms)]
56
#![allow(clippy::cast_lossless)]
67

src/machine.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
271271
ecx.assert_panic(msg, unwind)
272272
}
273273

274+
#[inline(always)]
275+
fn abort(_ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx, !> {
276+
throw_machine_stop!(TerminationInfo::Abort)
277+
}
278+
274279
#[inline(always)]
275280
fn binary_ptr_op(
276281
ecx: &rustc_mir::interpret::InterpCx<'mir, 'tcx, Self>,

src/shims/intrinsics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
3434
// Handle diverging intrinsics.
3535
let (dest, ret) = match intrinsic_name {
3636
"abort" => {
37+
// FIXME: remove, once the intrinsic on the rustc side is fixed.
3738
throw_machine_stop!(TerminationInfo::Abort);
3839
}
3940
"miri_start_panic" => return this.handle_miri_start_panic(args, unwind),
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// error-pattern: the evaluated program aborted
2+
#![feature(unwind_attributes)]
3+
4+
#[unwind(aborts)]
5+
fn panic_abort() { panic!() }
6+
7+
fn main() {
8+
panic_abort();
9+
}

0 commit comments

Comments
 (0)