Skip to content
This repository was archived by the owner on Nov 7, 2022. It is now read-only.

Use stable unreachable_unchecked rather than intrinsic unreachable. #40

Merged
merged 1 commit into from
May 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,12 @@ pub fn sev() {
/// Exception return
///
/// Will jump to wherever the corresponding link register points to, and therefore never return.
#[cfg(feature = "nightly")]
#[inline(always)]
pub fn eret() -> ! {
#[cfg(target_arch = "aarch64")]
unsafe {
core::arch::asm!("eret", options(nomem, nostack));
core::intrinsics::unreachable()
core::hint::unreachable_unchecked()
}

#[cfg(not(target_arch = "aarch64"))]
Expand All @@ -104,13 +103,12 @@ pub fn eret() -> ! {
/// Function return
///
/// Will jump to wherever the corresponding link register points to, and therefore never return.
#[cfg(feature = "nightly")]
#[inline(always)]
pub fn ret() -> ! {
#[cfg(target_arch = "aarch64")]
unsafe {
core::arch::asm!("ret", options(nomem, nostack));
core::intrinsics::unreachable()
core::hint::unreachable_unchecked()
}

#[cfg(not(target_arch = "aarch64"))]
Expand Down