Skip to content

Commit ab88dd2

Browse files
committed
Auto merge of rust-lang#80253 - Dylan-DPC:rollup-bkmn74z, r=Dylan-DPC
Rollup of 11 pull requests Successful merges: - rust-lang#80159 (Add array search aliases) - rust-lang#80166 (Edit rustc_middle docs) - rust-lang#80170 (Fix ICE when lookup method in trait for type that have bound vars) - rust-lang#80171 (Edit rustc_middle::ty::TyKind docs) - rust-lang#80199 (also const-check FakeRead) - rust-lang#80211 (Handle desugaring in impl trait bound suggestion) - rust-lang#80236 (Use pointer type in AtomicPtr::swap implementation) - rust-lang#80239 (Update Clippy) - rust-lang#80240 (make sure installer only creates directories in DESTDIR) - rust-lang#80244 (Cleanup markdown span handling) - rust-lang#80250 (Minor cleanups in LateResolver) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 8e347c4 + 8c34aa8 commit ab88dd2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

core/src/sync/atomic.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,8 +1040,16 @@ impl<T> AtomicPtr<T> {
10401040
#[stable(feature = "rust1", since = "1.0.0")]
10411041
#[cfg(target_has_atomic = "ptr")]
10421042
pub fn swap(&self, ptr: *mut T, order: Ordering) -> *mut T {
1043+
#[cfg(bootstrap)]
10431044
// SAFETY: data races are prevented by atomic intrinsics.
1044-
unsafe { atomic_swap(self.p.get() as *mut usize, ptr as usize, order) as *mut T }
1045+
unsafe {
1046+
atomic_swap(self.p.get() as *mut usize, ptr as usize, order) as *mut T
1047+
}
1048+
#[cfg(not(bootstrap))]
1049+
// SAFETY: data races are prevented by atomic intrinsics.
1050+
unsafe {
1051+
atomic_swap(self.p.get(), ptr, order)
1052+
}
10451053
}
10461054

10471055
/// Stores a value into the pointer if the current value is the same as the `current` value.

std/src/primitive_docs.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,10 @@ mod prim_unit {}
478478
#[stable(feature = "rust1", since = "1.0.0")]
479479
mod prim_pointer {}
480480

481+
#[doc(alias = "[]")]
482+
#[doc(alias = "[T;N]")] // unfortunately, rustdoc doesn't have fuzzy search for aliases
483+
#[doc(alias = "[T; N]")]
481484
#[doc(primitive = "array")]
482-
//
483485
/// A fixed-size array, denoted `[T; N]`, for the element type, `T`, and the
484486
/// non-negative compile-time constant size, `N`.
485487
///

0 commit comments

Comments
 (0)