Skip to content

Commit 21b7d68

Browse files
committed
Adds new intrinsic declaration
1 parent 9c707a8 commit 21b7d68

File tree

1 file changed

+11
-4
lines changed
  • library/core/src/intrinsics

1 file changed

+11
-4
lines changed

library/core/src/intrinsics/mod.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3577,7 +3577,6 @@ pub const fn discriminant_value<T>(_v: &T) -> <T as DiscriminantKind>::Discrimin
35773577
unimplemented!()
35783578
}
35793579

3580-
extern "rust-intrinsic" {
35813580
/// Rust's "try catch" construct for unwinding. Invokes the function pointer `try_fn` with the
35823581
/// data pointer `data`, and calls `catch_fn` if unwinding occurs while `try_fn` runs.
35833582
///
@@ -3594,18 +3593,26 @@ extern "rust-intrinsic" {
35943593
///
35953594
/// For more information, see the compiler's source, as well as the documentation for the stable
35963595
/// version of this intrinsic, `std::panic::catch_unwind`.
3596+
#[rustc_intrinsic]
3597+
#[rustc_intrinsic_must_be_overridden]
35973598
#[rustc_nounwind]
3598-
pub fn catch_unwind(try_fn: fn(*mut u8), data: *mut u8, catch_fn: fn(*mut u8, *mut u8)) -> i32;
3599+
pub unsafe fn catch_unwind(_try_fn: fn(*mut u8), _data: *mut u8, _catch_fn: fn(*mut u8, *mut u8)) -> i32 {
3600+
unreachable!()
3601+
}
35993602

36003603
/// Emits a `nontemporal` store, which gives a hint to the CPU that the data should not be held
36013604
/// in cache. Except for performance, this is fully equivalent to `ptr.write(val)`.
36023605
///
36033606
/// Not all architectures provide such an operation. For instance, x86 does not: while `MOVNT`
36043607
/// exists, that operation is *not* equivalent to `ptr.write(val)` (`MOVNT` writes can be reordered
36053608
/// in ways that are not allowed for regular writes).
3609+
#[rustc_intrinsic]
3610+
#[rustc_intrinsic_must_be_overridden]
36063611
#[rustc_nounwind]
3607-
pub fn nontemporal_store<T>(ptr: *mut T, val: T);
3608-
}
3612+
pub unsafe fn nontemporal_store<T>(_ptr: *mut T, _val: T) {
3613+
unreachable!()
3614+
}
3615+
36093616

36103617
/// See documentation of `<*const T>::offset_from` for details.
36113618
#[rustc_intrinsic_const_stable_indirect]

0 commit comments

Comments
 (0)