Skip to content

Commit d265a4b

Browse files
committed
avoid using core_intrinsics feature (for a transition)
1 parent 302f01e commit d265a4b

File tree

1 file changed

+133
-2
lines changed

1 file changed

+133
-2
lines changed

crates/core_arch/src/lib.rs

+133-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
simd_ffi,
1313
proc_macro_hygiene,
1414
stmt_expr_attributes,
15-
core_intrinsics,
1615
intrinsics,
1716
no_core,
1817
rustc_attrs,
@@ -85,4 +84,136 @@ pub mod arch {
8584
}
8685

8786
#[allow(unused_imports)]
88-
use core::{convert, ffi, hint, intrinsics, marker, mem, ops, ptr, sync};
87+
use core::{convert, ffi, hint, marker, mem, ops, ptr, sync};
88+
89+
// `core` is changing the feature name for the `intrinsics` module.
90+
// To permit that transition, we avoid using that feature for now.
91+
mod intrinsics {
92+
extern "rust-intrinsic" {
93+
/// Emits a `!nontemporal` store according to LLVM (see their docs).
94+
/// Probably will never become stable.
95+
#[rustc_nounwind]
96+
pub fn nontemporal_store<T>(ptr: *mut T, val: T);
97+
98+
/// Stores a value if the current value is the same as the `old` value.
99+
///
100+
/// The stabilized version of this intrinsic is available on the
101+
/// [`atomic`] types via the `compare_exchange` method by passing
102+
/// [`Ordering::Relaxed`] as both the success and failure parameters.
103+
/// For example, [`AtomicBool::compare_exchange`].
104+
#[rustc_nounwind]
105+
pub fn atomic_cxchg_relaxed_relaxed<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
106+
/// Stores a value if the current value is the same as the `old` value.
107+
///
108+
/// The stabilized version of this intrinsic is available on the
109+
/// [`atomic`] types via the `compare_exchange` method by passing
110+
/// [`Ordering::Relaxed`] and [`Ordering::Acquire`] as the success and failure parameters.
111+
/// For example, [`AtomicBool::compare_exchange`].
112+
#[rustc_nounwind]
113+
pub fn atomic_cxchg_relaxed_acquire<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
114+
/// Stores a value if the current value is the same as the `old` value.
115+
///
116+
/// The stabilized version of this intrinsic is available on the
117+
/// [`atomic`] types via the `compare_exchange` method by passing
118+
/// [`Ordering::Relaxed`] and [`Ordering::SeqCst`] as the success and failure parameters.
119+
/// For example, [`AtomicBool::compare_exchange`].
120+
#[rustc_nounwind]
121+
pub fn atomic_cxchg_relaxed_seqcst<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
122+
/// Stores a value if the current value is the same as the `old` value.
123+
///
124+
/// The stabilized version of this intrinsic is available on the
125+
/// [`atomic`] types via the `compare_exchange` method by passing
126+
/// [`Ordering::Acquire`] and [`Ordering::Relaxed`] as the success and failure parameters.
127+
/// For example, [`AtomicBool::compare_exchange`].
128+
#[rustc_nounwind]
129+
pub fn atomic_cxchg_acquire_relaxed<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
130+
/// Stores a value if the current value is the same as the `old` value.
131+
///
132+
/// The stabilized version of this intrinsic is available on the
133+
/// [`atomic`] types via the `compare_exchange` method by passing
134+
/// [`Ordering::Acquire`] as both the success and failure parameters.
135+
/// For example, [`AtomicBool::compare_exchange`].
136+
#[rustc_nounwind]
137+
pub fn atomic_cxchg_acquire_acquire<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
138+
/// Stores a value if the current value is the same as the `old` value.
139+
///
140+
/// The stabilized version of this intrinsic is available on the
141+
/// [`atomic`] types via the `compare_exchange` method by passing
142+
/// [`Ordering::Acquire`] and [`Ordering::SeqCst`] as the success and failure parameters.
143+
/// For example, [`AtomicBool::compare_exchange`].
144+
#[rustc_nounwind]
145+
pub fn atomic_cxchg_acquire_seqcst<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
146+
/// Stores a value if the current value is the same as the `old` value.
147+
///
148+
/// The stabilized version of this intrinsic is available on the
149+
/// [`atomic`] types via the `compare_exchange` method by passing
150+
/// [`Ordering::Release`] and [`Ordering::Relaxed`] as the success and failure parameters.
151+
/// For example, [`AtomicBool::compare_exchange`].
152+
#[rustc_nounwind]
153+
pub fn atomic_cxchg_release_relaxed<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
154+
/// Stores a value if the current value is the same as the `old` value.
155+
///
156+
/// The stabilized version of this intrinsic is available on the
157+
/// [`atomic`] types via the `compare_exchange` method by passing
158+
/// [`Ordering::Release`] and [`Ordering::Acquire`] as the success and failure parameters.
159+
/// For example, [`AtomicBool::compare_exchange`].
160+
#[rustc_nounwind]
161+
pub fn atomic_cxchg_release_acquire<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
162+
/// Stores a value if the current value is the same as the `old` value.
163+
///
164+
/// The stabilized version of this intrinsic is available on the
165+
/// [`atomic`] types via the `compare_exchange` method by passing
166+
/// [`Ordering::Release`] and [`Ordering::SeqCst`] as the success and failure parameters.
167+
/// For example, [`AtomicBool::compare_exchange`].
168+
#[rustc_nounwind]
169+
pub fn atomic_cxchg_release_seqcst<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
170+
/// Stores a value if the current value is the same as the `old` value.
171+
///
172+
/// The stabilized version of this intrinsic is available on the
173+
/// [`atomic`] types via the `compare_exchange` method by passing
174+
/// [`Ordering::AcqRel`] and [`Ordering::Relaxed`] as the success and failure parameters.
175+
/// For example, [`AtomicBool::compare_exchange`].
176+
#[rustc_nounwind]
177+
pub fn atomic_cxchg_acqrel_relaxed<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
178+
/// Stores a value if the current value is the same as the `old` value.
179+
///
180+
/// The stabilized version of this intrinsic is available on the
181+
/// [`atomic`] types via the `compare_exchange` method by passing
182+
/// [`Ordering::AcqRel`] and [`Ordering::Acquire`] as the success and failure parameters.
183+
/// For example, [`AtomicBool::compare_exchange`].
184+
#[rustc_nounwind]
185+
pub fn atomic_cxchg_acqrel_acquire<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
186+
/// Stores a value if the current value is the same as the `old` value.
187+
///
188+
/// The stabilized version of this intrinsic is available on the
189+
/// [`atomic`] types via the `compare_exchange` method by passing
190+
/// [`Ordering::AcqRel`] and [`Ordering::SeqCst`] as the success and failure parameters.
191+
/// For example, [`AtomicBool::compare_exchange`].
192+
#[rustc_nounwind]
193+
pub fn atomic_cxchg_acqrel_seqcst<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
194+
/// Stores a value if the current value is the same as the `old` value.
195+
///
196+
/// The stabilized version of this intrinsic is available on the
197+
/// [`atomic`] types via the `compare_exchange` method by passing
198+
/// [`Ordering::SeqCst`] and [`Ordering::Relaxed`] as the success and failure parameters.
199+
/// For example, [`AtomicBool::compare_exchange`].
200+
#[rustc_nounwind]
201+
pub fn atomic_cxchg_seqcst_relaxed<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
202+
/// Stores a value if the current value is the same as the `old` value.
203+
///
204+
/// The stabilized version of this intrinsic is available on the
205+
/// [`atomic`] types via the `compare_exchange` method by passing
206+
/// [`Ordering::SeqCst`] and [`Ordering::Acquire`] as the success and failure parameters.
207+
/// For example, [`AtomicBool::compare_exchange`].
208+
#[rustc_nounwind]
209+
pub fn atomic_cxchg_seqcst_acquire<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
210+
/// Stores a value if the current value is the same as the `old` value.
211+
///
212+
/// The stabilized version of this intrinsic is available on the
213+
/// [`atomic`] types via the `compare_exchange` method by passing
214+
/// [`Ordering::SeqCst`] as both the success and failure parameters.
215+
/// For example, [`AtomicBool::compare_exchange`].
216+
#[rustc_nounwind]
217+
pub fn atomic_cxchg_seqcst_seqcst<T: Copy>(dst: *mut T, old: T, src: T) -> (T, bool);
218+
}
219+
}

0 commit comments

Comments
 (0)