Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d514719

Browse files
authoredDec 9, 2024
Unrolled build for rust-lang#134013
Rollup merge of rust-lang#134013 - BLANKatGITHUB:intrinsic, r=saethlin Adds new intrinsic declaration This pr is for rust-lang#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 .
2 parents 4d669fb + 292fd0f commit d514719

File tree

1 file changed

+38
-28
lines changed
  • library/core/src/intrinsics

1 file changed

+38
-28
lines changed
 

‎library/core/src/intrinsics/mod.rs

+38-28
Original file line numberDiff line numberDiff line change
@@ -3577,34 +3577,44 @@ pub const fn discriminant_value<T>(_v: &T) -> <T as DiscriminantKind>::Discrimin
35773577
unimplemented!()
35783578
}
35793579

3580-
extern "rust-intrinsic" {
3581-
/// Rust's "try catch" construct for unwinding. Invokes the function pointer `try_fn` with the
3582-
/// data pointer `data`, and calls `catch_fn` if unwinding occurs while `try_fn` runs.
3583-
///
3584-
/// `catch_fn` must not unwind.
3585-
///
3586-
/// The third argument is a function called if an unwind occurs (both Rust `panic` and foreign
3587-
/// unwinds). This function takes the data pointer and a pointer to the target- and
3588-
/// runtime-specific exception object that was caught.
3589-
///
3590-
/// Note that in the case of a foreign unwinding operation, the exception object data may not be
3591-
/// safely usable from Rust, and should not be directly exposed via the standard library. To
3592-
/// prevent unsafe access, the library implementation may either abort the process or present an
3593-
/// opaque error type to the user.
3594-
///
3595-
/// For more information, see the compiler's source, as well as the documentation for the stable
3596-
/// version of this intrinsic, `std::panic::catch_unwind`.
3597-
#[rustc_nounwind]
3598-
pub fn catch_unwind(try_fn: fn(*mut u8), data: *mut u8, catch_fn: fn(*mut u8, *mut u8)) -> i32;
3599-
3600-
/// Emits a `nontemporal` store, which gives a hint to the CPU that the data should not be held
3601-
/// in cache. Except for performance, this is fully equivalent to `ptr.write(val)`.
3602-
///
3603-
/// Not all architectures provide such an operation. For instance, x86 does not: while `MOVNT`
3604-
/// exists, that operation is *not* equivalent to `ptr.write(val)` (`MOVNT` writes can be reordered
3605-
/// in ways that are not allowed for regular writes).
3606-
#[rustc_nounwind]
3607-
pub fn nontemporal_store<T>(ptr: *mut T, val: T);
3580+
/// Rust's "try catch" construct for unwinding. Invokes the function pointer `try_fn` with the
3581+
/// data pointer `data`, and calls `catch_fn` if unwinding occurs while `try_fn` runs.
3582+
///
3583+
/// `catch_fn` must not unwind.
3584+
///
3585+
/// The third argument is a function called if an unwind occurs (both Rust `panic` and foreign
3586+
/// unwinds). This function takes the data pointer and a pointer to the target- and
3587+
/// runtime-specific exception object that was caught.
3588+
///
3589+
/// Note that in the case of a foreign unwinding operation, the exception object data may not be
3590+
/// safely usable from Rust, and should not be directly exposed via the standard library. To
3591+
/// prevent unsafe access, the library implementation may either abort the process or present an
3592+
/// opaque error type to the user.
3593+
///
3594+
/// For more information, see the compiler's source, as well as the documentation for the stable
3595+
/// version of this intrinsic, `std::panic::catch_unwind`.
3596+
#[rustc_intrinsic]
3597+
#[rustc_intrinsic_must_be_overridden]
3598+
#[rustc_nounwind]
3599+
pub unsafe fn catch_unwind(
3600+
_try_fn: fn(*mut u8),
3601+
_data: *mut u8,
3602+
_catch_fn: fn(*mut u8, *mut u8),
3603+
) -> i32 {
3604+
unreachable!()
3605+
}
3606+
3607+
/// Emits a `nontemporal` store, which gives a hint to the CPU that the data should not be held
3608+
/// in cache. Except for performance, this is fully equivalent to `ptr.write(val)`.
3609+
///
3610+
/// Not all architectures provide such an operation. For instance, x86 does not: while `MOVNT`
3611+
/// exists, that operation is *not* equivalent to `ptr.write(val)` (`MOVNT` writes can be reordered
3612+
/// in ways that are not allowed for regular writes).
3613+
#[rustc_intrinsic]
3614+
#[rustc_intrinsic_must_be_overridden]
3615+
#[rustc_nounwind]
3616+
pub unsafe fn nontemporal_store<T>(_ptr: *mut T, _val: T) {
3617+
unreachable!()
36083618
}
36093619

36103620
/// See documentation of `<*const T>::offset_from` for details.

0 commit comments

Comments
 (0)
Failed to load comments.