Skip to content

Commit ee04cb2

Browse files
committed
warn against using intrinsics that leave the scope of our memory model
1 parent 85c42b7 commit ee04cb2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/core/src/intrinsics.rs

+4
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ extern "rust-intrinsic" {
341341
/// [`Ordering::Relaxed`] as the `order`. For example, [`AtomicBool::load`].
342342
#[rustc_nounwind]
343343
pub fn atomic_load_relaxed<T: Copy>(src: *const T) -> T;
344+
/// Do NOT use this intrinsic; "unordered" operations do not exist in our memory model!
344345
#[rustc_nounwind]
345346
pub fn atomic_load_unordered<T: Copy>(src: *const T) -> T;
346347

@@ -365,6 +366,7 @@ extern "rust-intrinsic" {
365366
/// [`Ordering::Relaxed`] as the `order`. For example, [`AtomicBool::store`].
366367
#[rustc_nounwind]
367368
pub fn atomic_store_relaxed<T: Copy>(dst: *mut T, val: T);
369+
/// Do NOT use this intrinsic; "unordered" operations do not exist in our memory model!
368370
#[rustc_nounwind]
369371
pub fn atomic_store_unordered<T: Copy>(dst: *mut T, val: T);
370372

@@ -2312,6 +2314,8 @@ extern "rust-intrinsic" {
23122314

23132315
/// Emits a `!nontemporal` store according to LLVM (see their docs).
23142316
/// Probably will never become stable.
2317+
///
2318+
/// Do NOT use this intrinsic; "nontemporal" operations do not exist in our memory model!
23152319
#[rustc_nounwind]
23162320
pub fn nontemporal_store<T>(ptr: *mut T, val: T);
23172321

0 commit comments

Comments
 (0)