Skip to content

Commit 229b0a0

Browse files
committed
Make rust-intrinsic ABI unwindable
Stick `#[rustc_nounwind]` to all except `const_eval_select` to undo the change for all other intrinsics.
1 parent 9be9b5e commit 229b0a0

File tree

4 files changed

+236
-3
lines changed

4 files changed

+236
-3
lines changed

compiler/rustc_middle/src/ty/layout.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,10 +1226,11 @@ pub fn fn_can_unwind(tcx: TyCtxt<'_>, fn_def_id: Option<DefId>, abi: SpecAbi) ->
12261226
| AvrNonBlockingInterrupt
12271227
| CCmseNonSecureCall
12281228
| Wasm
1229-
| RustIntrinsic
12301229
| PlatformIntrinsic
12311230
| Unadjusted => false,
1232-
Rust | RustCall | RustCold => tcx.sess.panic_strategy() == PanicStrategy::Unwind,
1231+
Rust | RustCall | RustCold | RustIntrinsic => {
1232+
tcx.sess.panic_strategy() == PanicStrategy::Unwind
1233+
}
12331234
}
12341235
}
12351236

library/core/src/ffi/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,12 +615,15 @@ impl<'f> Drop for VaListImpl<'f> {
615615
extern "rust-intrinsic" {
616616
/// Destroy the arglist `ap` after initialization with `va_start` or
617617
/// `va_copy`.
618+
#[rustc_nounwind]
618619
fn va_end(ap: &mut VaListImpl<'_>);
619620

620621
/// Copies the current location of arglist `src` to the arglist `dst`.
622+
#[rustc_nounwind]
621623
fn va_copy<'f>(dest: *mut VaListImpl<'f>, src: &VaListImpl<'f>);
622624

623625
/// Loads an argument of type `T` from the `va_list` `ap` and increment the
624626
/// argument `ap` points to.
627+
#[rustc_nounwind]
625628
fn va_arg<T: sealed_trait::VaArgSafe>(ap: &mut VaListImpl<'_>) -> T;
626629
}

0 commit comments

Comments
 (0)