@@ -63,222 +63,14 @@ use crate::mem;
6363use crate :: sync:: atomic:: { self , AtomicBool , AtomicI32 , AtomicIsize , AtomicU32 , Ordering } ;
6464
6565#[ stable( feature = "drop_in_place" , since = "1.8.0" ) ]
66- #[ cfg_attr ( not ( bootstrap ) , rustc_allowed_through_unstable_modules) ]
66+ #[ rustc_allowed_through_unstable_modules]
6767#[ deprecated( note = "no longer an intrinsic - use `ptr::drop_in_place` directly" , since = "1.52.0" ) ]
6868#[ inline]
6969pub unsafe fn drop_in_place < T : ?Sized > ( to_drop : * mut T ) {
7070 // SAFETY: see `ptr::drop_in_place`
7171 unsafe { crate :: ptr:: drop_in_place ( to_drop) }
7272}
7373
74- // These have been renamed.
75- #[ cfg( bootstrap) ]
76- extern "rust-intrinsic" {
77- pub fn atomic_cxchg < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
78- pub fn atomic_cxchg_acq < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
79- pub fn atomic_cxchg_rel < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
80- pub fn atomic_cxchg_acqrel < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
81- pub fn atomic_cxchg_relaxed < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
82- pub fn atomic_cxchg_failrelaxed < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
83- pub fn atomic_cxchg_failacq < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
84- pub fn atomic_cxchg_acq_failrelaxed < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
85- pub fn atomic_cxchg_acqrel_failrelaxed < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
86- pub fn atomic_cxchgweak < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
87- pub fn atomic_cxchgweak_acq < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
88- pub fn atomic_cxchgweak_rel < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
89- pub fn atomic_cxchgweak_acqrel < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
90- pub fn atomic_cxchgweak_relaxed < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
91- pub fn atomic_cxchgweak_failrelaxed < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
92- pub fn atomic_cxchgweak_failacq < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
93- pub fn atomic_cxchgweak_acq_failrelaxed < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
94- pub fn atomic_cxchgweak_acqrel_failrelaxed < T : Copy > ( dst : * mut T , old : T , src : T ) -> ( T , bool ) ;
95- pub fn atomic_load < T : Copy > ( src : * const T ) -> T ;
96- pub fn atomic_load_acq < T : Copy > ( src : * const T ) -> T ;
97- pub fn atomic_load_relaxed < T : Copy > ( src : * const T ) -> T ;
98- pub fn atomic_load_unordered < T : Copy > ( src : * const T ) -> T ;
99- pub fn atomic_store < T : Copy > ( dst : * mut T , val : T ) ;
100- pub fn atomic_store_rel < T : Copy > ( dst : * mut T , val : T ) ;
101- pub fn atomic_store_relaxed < T : Copy > ( dst : * mut T , val : T ) ;
102- pub fn atomic_store_unordered < T : Copy > ( dst : * mut T , val : T ) ;
103- pub fn atomic_xchg < T : Copy > ( dst : * mut T , src : T ) -> T ;
104- pub fn atomic_xchg_acq < T : Copy > ( dst : * mut T , src : T ) -> T ;
105- pub fn atomic_xchg_rel < T : Copy > ( dst : * mut T , src : T ) -> T ;
106- pub fn atomic_xchg_acqrel < T : Copy > ( dst : * mut T , src : T ) -> T ;
107- pub fn atomic_xchg_relaxed < T : Copy > ( dst : * mut T , src : T ) -> T ;
108- pub fn atomic_xadd < T : Copy > ( dst : * mut T , src : T ) -> T ;
109- pub fn atomic_xadd_acq < T : Copy > ( dst : * mut T , src : T ) -> T ;
110- pub fn atomic_xadd_rel < T : Copy > ( dst : * mut T , src : T ) -> T ;
111- pub fn atomic_xadd_acqrel < T : Copy > ( dst : * mut T , src : T ) -> T ;
112- pub fn atomic_xadd_relaxed < T : Copy > ( dst : * mut T , src : T ) -> T ;
113- pub fn atomic_xsub < T : Copy > ( dst : * mut T , src : T ) -> T ;
114- pub fn atomic_xsub_acq < T : Copy > ( dst : * mut T , src : T ) -> T ;
115- pub fn atomic_xsub_rel < T : Copy > ( dst : * mut T , src : T ) -> T ;
116- pub fn atomic_xsub_acqrel < T : Copy > ( dst : * mut T , src : T ) -> T ;
117- pub fn atomic_xsub_relaxed < T : Copy > ( dst : * mut T , src : T ) -> T ;
118- pub fn atomic_and < T : Copy > ( dst : * mut T , src : T ) -> T ;
119- pub fn atomic_and_acq < T : Copy > ( dst : * mut T , src : T ) -> T ;
120- pub fn atomic_and_rel < T : Copy > ( dst : * mut T , src : T ) -> T ;
121- pub fn atomic_and_acqrel < T : Copy > ( dst : * mut T , src : T ) -> T ;
122- pub fn atomic_and_relaxed < T : Copy > ( dst : * mut T , src : T ) -> T ;
123- pub fn atomic_nand < T : Copy > ( dst : * mut T , src : T ) -> T ;
124- pub fn atomic_nand_acq < T : Copy > ( dst : * mut T , src : T ) -> T ;
125- pub fn atomic_nand_rel < T : Copy > ( dst : * mut T , src : T ) -> T ;
126- pub fn atomic_nand_acqrel < T : Copy > ( dst : * mut T , src : T ) -> T ;
127- pub fn atomic_nand_relaxed < T : Copy > ( dst : * mut T , src : T ) -> T ;
128- pub fn atomic_or < T : Copy > ( dst : * mut T , src : T ) -> T ;
129- pub fn atomic_or_acq < T : Copy > ( dst : * mut T , src : T ) -> T ;
130- pub fn atomic_or_rel < T : Copy > ( dst : * mut T , src : T ) -> T ;
131- pub fn atomic_or_acqrel < T : Copy > ( dst : * mut T , src : T ) -> T ;
132- pub fn atomic_or_relaxed < T : Copy > ( dst : * mut T , src : T ) -> T ;
133- pub fn atomic_xor < T : Copy > ( dst : * mut T , src : T ) -> T ;
134- pub fn atomic_xor_acq < T : Copy > ( dst : * mut T , src : T ) -> T ;
135- pub fn atomic_xor_rel < T : Copy > ( dst : * mut T , src : T ) -> T ;
136- pub fn atomic_xor_acqrel < T : Copy > ( dst : * mut T , src : T ) -> T ;
137- pub fn atomic_xor_relaxed < T : Copy > ( dst : * mut T , src : T ) -> T ;
138- pub fn atomic_max < T : Copy > ( dst : * mut T , src : T ) -> T ;
139- pub fn atomic_max_acq < T : Copy > ( dst : * mut T , src : T ) -> T ;
140- pub fn atomic_max_rel < T : Copy > ( dst : * mut T , src : T ) -> T ;
141- pub fn atomic_max_acqrel < T : Copy > ( dst : * mut T , src : T ) -> T ;
142- pub fn atomic_max_relaxed < T : Copy > ( dst : * mut T , src : T ) -> T ;
143- pub fn atomic_min < T : Copy > ( dst : * mut T , src : T ) -> T ;
144- pub fn atomic_min_acq < T : Copy > ( dst : * mut T , src : T ) -> T ;
145- pub fn atomic_min_rel < T : Copy > ( dst : * mut T , src : T ) -> T ;
146- pub fn atomic_min_acqrel < T : Copy > ( dst : * mut T , src : T ) -> T ;
147- pub fn atomic_min_relaxed < T : Copy > ( dst : * mut T , src : T ) -> T ;
148- pub fn atomic_umin < T : Copy > ( dst : * mut T , src : T ) -> T ;
149- pub fn atomic_umin_acq < T : Copy > ( dst : * mut T , src : T ) -> T ;
150- pub fn atomic_umin_rel < T : Copy > ( dst : * mut T , src : T ) -> T ;
151- pub fn atomic_umin_acqrel < T : Copy > ( dst : * mut T , src : T ) -> T ;
152- pub fn atomic_umin_relaxed < T : Copy > ( dst : * mut T , src : T ) -> T ;
153- pub fn atomic_umax < T : Copy > ( dst : * mut T , src : T ) -> T ;
154- pub fn atomic_umax_acq < T : Copy > ( dst : * mut T , src : T ) -> T ;
155- pub fn atomic_umax_rel < T : Copy > ( dst : * mut T , src : T ) -> T ;
156- pub fn atomic_umax_acqrel < T : Copy > ( dst : * mut T , src : T ) -> T ;
157- pub fn atomic_umax_relaxed < T : Copy > ( dst : * mut T , src : T ) -> T ;
158- pub fn atomic_fence ( ) ;
159- pub fn atomic_fence_acq ( ) ;
160- pub fn atomic_fence_rel ( ) ;
161- pub fn atomic_fence_acqrel ( ) ;
162- pub fn atomic_singlethreadfence ( ) ;
163- pub fn atomic_singlethreadfence_acq ( ) ;
164- pub fn atomic_singlethreadfence_rel ( ) ;
165- pub fn atomic_singlethreadfence_acqrel ( ) ;
166- }
167-
168- // These have been renamed.
169- #[ cfg( bootstrap) ]
170- mod atomics {
171- pub use super :: atomic_cxchg as atomic_cxchg_seqcst_seqcst;
172- pub use super :: atomic_cxchg_acq as atomic_cxchg_acquire_acquire;
173- pub use super :: atomic_cxchg_acq_failrelaxed as atomic_cxchg_acquire_relaxed;
174- pub use super :: atomic_cxchg_acqrel as atomic_cxchg_acqrel_acquire;
175- pub use super :: atomic_cxchg_acqrel_failrelaxed as atomic_cxchg_acqrel_relaxed;
176- pub use super :: atomic_cxchg_failacq as atomic_cxchg_seqcst_acquire;
177- pub use super :: atomic_cxchg_failrelaxed as atomic_cxchg_seqcst_relaxed;
178- pub use super :: atomic_cxchg_rel as atomic_cxchg_release_relaxed;
179- pub use super :: atomic_cxchg_relaxed as atomic_cxchg_relaxed_relaxed;
180-
181- pub use super :: atomic_cxchgweak as atomic_cxchgweak_seqcst_seqcst;
182- pub use super :: atomic_cxchgweak_acq as atomic_cxchgweak_acquire_acquire;
183- pub use super :: atomic_cxchgweak_acq_failrelaxed as atomic_cxchgweak_acquire_relaxed;
184- pub use super :: atomic_cxchgweak_acqrel as atomic_cxchgweak_acqrel_acquire;
185- pub use super :: atomic_cxchgweak_acqrel_failrelaxed as atomic_cxchgweak_acqrel_relaxed;
186- pub use super :: atomic_cxchgweak_failacq as atomic_cxchgweak_seqcst_acquire;
187- pub use super :: atomic_cxchgweak_failrelaxed as atomic_cxchgweak_seqcst_relaxed;
188- pub use super :: atomic_cxchgweak_rel as atomic_cxchgweak_release_relaxed;
189- pub use super :: atomic_cxchgweak_relaxed as atomic_cxchgweak_relaxed_relaxed;
190-
191- pub use super :: atomic_load as atomic_load_seqcst;
192- pub use super :: atomic_load_acq as atomic_load_acquire;
193- pub use super :: atomic_load_relaxed;
194- pub use super :: atomic_load_unordered;
195-
196- pub use super :: atomic_store as atomic_store_seqcst;
197- pub use super :: atomic_store_rel as atomic_store_release;
198- pub use super :: atomic_store_relaxed;
199- pub use super :: atomic_store_unordered;
200-
201- pub use super :: atomic_xchg as atomic_xchg_seqcst;
202- pub use super :: atomic_xchg_acq as atomic_xchg_acquire;
203- pub use super :: atomic_xchg_acqrel;
204- pub use super :: atomic_xchg_rel as atomic_xchg_release;
205- pub use super :: atomic_xchg_relaxed;
206-
207- pub use super :: atomic_xadd as atomic_xadd_seqcst;
208- pub use super :: atomic_xadd_acq as atomic_xadd_acquire;
209- pub use super :: atomic_xadd_acqrel;
210- pub use super :: atomic_xadd_rel as atomic_xadd_release;
211- pub use super :: atomic_xadd_relaxed;
212-
213- pub use super :: atomic_xsub as atomic_xsub_seqcst;
214- pub use super :: atomic_xsub_acq as atomic_xsub_acquire;
215- pub use super :: atomic_xsub_acqrel;
216- pub use super :: atomic_xsub_rel as atomic_xsub_release;
217- pub use super :: atomic_xsub_relaxed;
218-
219- pub use super :: atomic_and as atomic_and_seqcst;
220- pub use super :: atomic_and_acq as atomic_and_acquire;
221- pub use super :: atomic_and_acqrel;
222- pub use super :: atomic_and_rel as atomic_and_release;
223- pub use super :: atomic_and_relaxed;
224-
225- pub use super :: atomic_nand as atomic_nand_seqcst;
226- pub use super :: atomic_nand_acq as atomic_nand_acquire;
227- pub use super :: atomic_nand_acqrel;
228- pub use super :: atomic_nand_rel as atomic_nand_release;
229- pub use super :: atomic_nand_relaxed;
230-
231- pub use super :: atomic_or as atomic_or_seqcst;
232- pub use super :: atomic_or_acq as atomic_or_acquire;
233- pub use super :: atomic_or_acqrel;
234- pub use super :: atomic_or_rel as atomic_or_release;
235- pub use super :: atomic_or_relaxed;
236-
237- pub use super :: atomic_xor as atomic_xor_seqcst;
238- pub use super :: atomic_xor_acq as atomic_xor_acquire;
239- pub use super :: atomic_xor_acqrel;
240- pub use super :: atomic_xor_rel as atomic_xor_release;
241- pub use super :: atomic_xor_relaxed;
242-
243- pub use super :: atomic_max as atomic_max_seqcst;
244- pub use super :: atomic_max_acq as atomic_max_acquire;
245- pub use super :: atomic_max_acqrel;
246- pub use super :: atomic_max_rel as atomic_max_release;
247- pub use super :: atomic_max_relaxed;
248-
249- pub use super :: atomic_min as atomic_min_seqcst;
250- pub use super :: atomic_min_acq as atomic_min_acquire;
251- pub use super :: atomic_min_acqrel;
252- pub use super :: atomic_min_rel as atomic_min_release;
253- pub use super :: atomic_min_relaxed;
254-
255- pub use super :: atomic_umin as atomic_umin_seqcst;
256- pub use super :: atomic_umin_acq as atomic_umin_acquire;
257- pub use super :: atomic_umin_acqrel;
258- pub use super :: atomic_umin_rel as atomic_umin_release;
259- pub use super :: atomic_umin_relaxed;
260-
261- pub use super :: atomic_umax as atomic_umax_seqcst;
262- pub use super :: atomic_umax_acq as atomic_umax_acquire;
263- pub use super :: atomic_umax_acqrel;
264- pub use super :: atomic_umax_rel as atomic_umax_release;
265- pub use super :: atomic_umax_relaxed;
266-
267- pub use super :: atomic_fence as atomic_fence_seqcst;
268- pub use super :: atomic_fence_acq as atomic_fence_acquire;
269- pub use super :: atomic_fence_acqrel;
270- pub use super :: atomic_fence_rel as atomic_fence_release;
271-
272- pub use super :: atomic_singlethreadfence as atomic_singlethreadfence_seqcst;
273- pub use super :: atomic_singlethreadfence_acq as atomic_singlethreadfence_acquire;
274- pub use super :: atomic_singlethreadfence_acqrel;
275- pub use super :: atomic_singlethreadfence_rel as atomic_singlethreadfence_release;
276- }
277-
278- #[ cfg( bootstrap) ]
279- pub use atomics:: * ;
280-
281- #[ cfg( not( bootstrap) ) ]
28274extern "rust-intrinsic" {
28375 // N.B., these intrinsics take raw pointers because they mutate aliased
28476 // memory, which is not valid for either `&` or `&mut`.
@@ -951,7 +743,6 @@ extern "rust-intrinsic" {
951743//
952744// These are the aliases for the old names.
953745// To be removed when stdarch and panic_unwind have been updated.
954- #[ cfg( not( bootstrap) ) ]
955746mod atomics {
956747 pub use super :: atomic_cxchg_acqrel_acquire as atomic_cxchg_acqrel;
957748 pub use super :: atomic_cxchg_acqrel_relaxed as atomic_cxchg_acqrel_failrelaxed;
@@ -965,7 +756,6 @@ mod atomics {
965756 pub use super :: atomic_store_seqcst as atomic_store;
966757}
967758
968- #[ cfg( not( bootstrap) ) ]
969759pub use atomics:: * ;
970760
971761extern "rust-intrinsic" {
@@ -1463,7 +1253,7 @@ extern "rust-intrinsic" {
14631253 /// }
14641254 /// ```
14651255 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1466- #[ cfg_attr ( not ( bootstrap ) , rustc_allowed_through_unstable_modules) ]
1256+ #[ rustc_allowed_through_unstable_modules]
14671257 #[ rustc_const_stable( feature = "const_transmute" , since = "1.56.0" ) ]
14681258 #[ rustc_diagnostic_item = "transmute" ]
14691259 pub fn transmute < T , U > ( e : T ) -> U ;
@@ -2300,12 +2090,10 @@ extern "rust-intrinsic" {
23002090
23012091 /// `ptr` must point to a vtable.
23022092 /// The intrinsic will return the size stored in that vtable.
2303- #[ cfg( not( bootstrap) ) ]
23042093 pub fn vtable_size ( ptr : * const ( ) ) -> usize ;
23052094
23062095 /// `ptr` must point to a vtable.
23072096 /// The intrinsic will return the alignment stored in that vtable.
2308- #[ cfg( not( bootstrap) ) ]
23092097 pub fn vtable_align ( ptr : * const ( ) ) -> usize ;
23102098}
23112099
@@ -2452,7 +2240,7 @@ pub(crate) fn is_nonoverlapping<T>(src: *const T, dst: *const T, count: usize) -
24522240/// [`Vec::append`]: ../../std/vec/struct.Vec.html#method.append
24532241#[ doc( alias = "memcpy" ) ]
24542242#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2455- #[ cfg_attr ( not ( bootstrap ) , rustc_allowed_through_unstable_modules) ]
2243+ #[ rustc_allowed_through_unstable_modules]
24562244#[ rustc_const_stable( feature = "const_intrinsic_copy" , since = "1.63.0" ) ]
24572245#[ inline]
24582246#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
@@ -2539,7 +2327,7 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
25392327/// ```
25402328#[ doc( alias = "memmove" ) ]
25412329#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2542- #[ cfg_attr ( not ( bootstrap ) , rustc_allowed_through_unstable_modules) ]
2330+ #[ rustc_allowed_through_unstable_modules]
25432331#[ rustc_const_stable( feature = "const_intrinsic_copy" , since = "1.63.0" ) ]
25442332#[ inline]
25452333#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
@@ -2607,7 +2395,7 @@ pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
26072395/// ```
26082396#[ doc( alias = "memset" ) ]
26092397#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2610- #[ cfg_attr ( not ( bootstrap ) , rustc_allowed_through_unstable_modules) ]
2398+ #[ rustc_allowed_through_unstable_modules]
26112399#[ rustc_const_unstable( feature = "const_ptr_write" , issue = "86302" ) ]
26122400#[ inline]
26132401#[ cfg_attr( miri, track_caller) ] // even without panics, this helps for Miri backtraces
0 commit comments