Rollup merge of #134013 - BLANKatGITHUB:intrinsic, r=saethlin
Adds new intrinsic declaration This pr is for #132735 removes removes `extern "intrinsic"` I think its the last block of this file and was kind of asking for advice how to handle other files as mentioned in the issue .
This commit is contained in:
commit
fe5f5fd6b5
1 changed files with 37 additions and 27 deletions
|
@ -3577,7 +3577,6 @@ pub const fn discriminant_value<T>(_v: &T) -> <T as DiscriminantKind>::Discrimin
|
|||
unimplemented!()
|
||||
}
|
||||
|
||||
extern "rust-intrinsic" {
|
||||
/// Rust's "try catch" construct for unwinding. Invokes the function pointer `try_fn` with the
|
||||
/// data pointer `data`, and calls `catch_fn` if unwinding occurs while `try_fn` runs.
|
||||
///
|
||||
|
@ -3594,8 +3593,16 @@ extern "rust-intrinsic" {
|
|||
///
|
||||
/// For more information, see the compiler's source, as well as the documentation for the stable
|
||||
/// version of this intrinsic, `std::panic::catch_unwind`.
|
||||
#[rustc_intrinsic]
|
||||
#[rustc_intrinsic_must_be_overridden]
|
||||
#[rustc_nounwind]
|
||||
pub fn catch_unwind(try_fn: fn(*mut u8), data: *mut u8, catch_fn: fn(*mut u8, *mut u8)) -> i32;
|
||||
pub unsafe fn catch_unwind(
|
||||
_try_fn: fn(*mut u8),
|
||||
_data: *mut u8,
|
||||
_catch_fn: fn(*mut u8, *mut u8),
|
||||
) -> i32 {
|
||||
unreachable!()
|
||||
}
|
||||
|
||||
/// Emits a `nontemporal` store, which gives a hint to the CPU that the data should not be held
|
||||
/// in cache. Except for performance, this is fully equivalent to `ptr.write(val)`.
|
||||
|
@ -3603,8 +3610,11 @@ extern "rust-intrinsic" {
|
|||
/// Not all architectures provide such an operation. For instance, x86 does not: while `MOVNT`
|
||||
/// exists, that operation is *not* equivalent to `ptr.write(val)` (`MOVNT` writes can be reordered
|
||||
/// in ways that are not allowed for regular writes).
|
||||
#[rustc_intrinsic]
|
||||
#[rustc_intrinsic_must_be_overridden]
|
||||
#[rustc_nounwind]
|
||||
pub fn nontemporal_store<T>(ptr: *mut T, val: T);
|
||||
pub unsafe fn nontemporal_store<T>(_ptr: *mut T, _val: T) {
|
||||
unreachable!()
|
||||
}
|
||||
|
||||
/// See documentation of `<*const T>::offset_from` for details.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue