Skip to content

Commit dbab4e1

Browse files
committed
Auto merge of rust-lang#140895 - matthiaskrgr:rollup-rfvqv4t, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#129334 (Implement (part of) ACP 429: add `DerefMut` to `Lazy[Cell/Lock]`) - rust-lang#139562 (rustdoc: add a handle that makes sidebar resizing more obvious) - rust-lang#140151 (remove intrinsics::drop_in_place) - rust-lang#140660 (remove 'unordered' atomic intrinsics) - rust-lang#140783 (Update documentation of OnceLock::get_or_init.) - rust-lang#140789 (Update hermit-abi to 0.5.1) - rust-lang#140879 (1.87.0 release notes: remove nonsensical `~` operator) r? `@ghost` `@rustbot` modify labels: rollup
2 parents b105556 + 3ca41e2 commit dbab4e1

30 files changed

+110
-93
lines changed

RELEASES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Version 1.87.0 (2025-05-15)
66
Language
77
--------
88
- [Stabilize `asm_goto` feature](https://github.com/rust-lang/rust/pull/133870)
9-
- [Allow parsing open beginning ranges (`..EXPR`) after unary operators `!`, `~`, `-`, and `*`}](https://github.com/rust-lang/rust/pull/134900).
9+
- [Allow parsing open beginning ranges (`..EXPR`) after unary operators `!`, `-`, and `*`](https://github.com/rust-lang/rust/pull/134900).
1010
- [Don't require method impls for methods with `Self: Sized` bounds in `impl`s for unsized types](https://github.com/rust-lang/rust/pull/135480)
1111
- [Stabilize `feature(precise_capturing_in_traits)` allowing `use<...>` bounds on return position `impl Trait` in `trait`s](https://github.com/rust-lang/rust/pull/138128)
1212

compiler/rustc_codegen_gcc/src/builder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2454,7 +2454,6 @@ impl ToGccOrdering for AtomicOrdering {
24542454
use MemOrdering::*;
24552455

24562456
let ordering = match self {
2457-
AtomicOrdering::Unordered => __ATOMIC_RELAXED,
24582457
AtomicOrdering::Relaxed => __ATOMIC_RELAXED, // TODO(antoyo): check if that's the same.
24592458
AtomicOrdering::Acquire => __ATOMIC_ACQUIRE,
24602459
AtomicOrdering::Release => __ATOMIC_RELEASE,

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ impl AtomicRmwBinOp {
415415
pub(crate) enum AtomicOrdering {
416416
#[allow(dead_code)]
417417
NotAtomic = 0,
418+
#[allow(dead_code)]
418419
Unordered = 1,
419420
Monotonic = 2,
420421
// Consume = 3, // Not specified yet.
@@ -428,7 +429,6 @@ impl AtomicOrdering {
428429
pub(crate) fn from_generic(ao: rustc_codegen_ssa::common::AtomicOrdering) -> Self {
429430
use rustc_codegen_ssa::common::AtomicOrdering as Common;
430431
match ao {
431-
Common::Unordered => Self::Unordered,
432432
Common::Relaxed => Self::Monotonic,
433433
Common::Acquire => Self::Acquire,
434434
Common::Release => Self::Release,

compiler/rustc_codegen_ssa/src/common.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ pub enum AtomicRmwBinOp {
6161

6262
#[derive(Copy, Clone, Debug)]
6363
pub enum AtomicOrdering {
64-
Unordered,
6564
Relaxed,
6665
Acquire,
6766
Release,

compiler/rustc_codegen_ssa/src/mir/intrinsic.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
336336
};
337337

338338
let parse_ordering = |bx: &Bx, s| match s {
339-
"unordered" => Unordered,
340339
"relaxed" => Relaxed,
341340
"acquire" => Acquire,
342341
"release" => Release,

library/Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ dependencies = [
139139

140140
[[package]]
141141
name = "hermit-abi"
142-
version = "0.5.0"
142+
version = "0.5.1"
143143
source = "registry+https://github.com/rust-lang/crates.io-index"
144-
checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e"
144+
checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08"
145145
dependencies = [
146146
"compiler_builtins",
147147
"rustc-std-workspace-alloc",

library/core/src/cell/lazy.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::UnsafeCell;
22
use crate::hint::unreachable_unchecked;
3-
use crate::ops::Deref;
3+
use crate::ops::{Deref, DerefMut};
44
use crate::{fmt, mem};
55

66
enum State<T, F> {
@@ -284,6 +284,14 @@ impl<T, F: FnOnce() -> T> Deref for LazyCell<T, F> {
284284
}
285285
}
286286

287+
#[stable(feature = "lazy_deref_mut", since = "CURRENT_RUSTC_VERSION")]
288+
impl<T, F: FnOnce() -> T> DerefMut for LazyCell<T, F> {
289+
#[inline]
290+
fn deref_mut(&mut self) -> &mut T {
291+
LazyCell::force_mut(self)
292+
}
293+
}
294+
287295
#[stable(feature = "lazy_cell", since = "1.80.0")]
288296
impl<T: Default> Default for LazyCell<T> {
289297
/// Creates a new lazy value using `Default` as the initializing function.

library/core/src/intrinsics/mod.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,6 @@ pub mod simd;
7474
#[cfg(all(target_has_atomic = "8", target_has_atomic = "32", target_has_atomic = "ptr"))]
7575
use crate::sync::atomic::{self, AtomicBool, AtomicI32, AtomicIsize, AtomicU32, Ordering};
7676

77-
#[stable(feature = "drop_in_place", since = "1.8.0")]
78-
#[rustc_allowed_through_unstable_modules = "import this function via `std::ptr` instead"]
79-
#[deprecated(note = "no longer an intrinsic - use `ptr::drop_in_place` directly", since = "1.52.0")]
80-
#[inline]
81-
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
82-
// SAFETY: see `ptr::drop_in_place`
83-
unsafe { crate::ptr::drop_in_place(to_drop) }
84-
}
85-
8677
// N.B., these intrinsics take raw pointers because they mutate aliased
8778
// memory, which is not valid for either `&` or `&mut`.
8879

@@ -439,12 +430,6 @@ pub unsafe fn atomic_load_acquire<T: Copy>(src: *const T) -> T;
439430
#[rustc_intrinsic]
440431
#[rustc_nounwind]
441432
pub unsafe fn atomic_load_relaxed<T: Copy>(src: *const T) -> T;
442-
/// Do NOT use this intrinsic; "unordered" operations do not exist in our memory model!
443-
/// In terms of the Rust Abstract Machine, this operation is equivalent to `src.read()`,
444-
/// i.e., it performs a non-atomic read.
445-
#[rustc_intrinsic]
446-
#[rustc_nounwind]
447-
pub unsafe fn atomic_load_unordered<T: Copy>(src: *const T) -> T;
448433

449434
/// Stores the value at the specified memory location.
450435
/// `T` must be an integer or pointer type.
@@ -473,12 +458,6 @@ pub unsafe fn atomic_store_release<T: Copy>(dst: *mut T, val: T);
473458
#[rustc_intrinsic]
474459
#[rustc_nounwind]
475460
pub unsafe fn atomic_store_relaxed<T: Copy>(dst: *mut T, val: T);
476-
/// Do NOT use this intrinsic; "unordered" operations do not exist in our memory model!
477-
/// In terms of the Rust Abstract Machine, this operation is equivalent to `dst.write(val)`,
478-
/// i.e., it performs a non-atomic write.
479-
#[rustc_intrinsic]
480-
#[rustc_nounwind]
481-
pub unsafe fn atomic_store_unordered<T: Copy>(dst: *mut T, val: T);
482461

483462
/// Stores the value at the specified memory location, returning the old value.
484463
/// `T` must be an integer or pointer type.

library/std/src/sync/lazy_lock.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::poison::once::ExclusiveState;
22
use crate::cell::UnsafeCell;
33
use crate::mem::ManuallyDrop;
4-
use crate::ops::Deref;
4+
use crate::ops::{Deref, DerefMut};
55
use crate::panic::{RefUnwindSafe, UnwindSafe};
66
use crate::sync::Once;
77
use crate::{fmt, ptr};
@@ -313,6 +313,14 @@ impl<T, F: FnOnce() -> T> Deref for LazyLock<T, F> {
313313
}
314314
}
315315

316+
#[stable(feature = "lazy_deref_mut", since = "CURRENT_RUSTC_VERSION")]
317+
impl<T, F: FnOnce() -> T> DerefMut for LazyLock<T, F> {
318+
#[inline]
319+
fn deref_mut(&mut self) -> &mut T {
320+
LazyLock::force_mut(self)
321+
}
322+
}
323+
316324
#[stable(feature = "lazy_cell", since = "1.80.0")]
317325
impl<T: Default> Default for LazyLock<T> {
318326
/// Creates a new lazy value using `Default` as the initializing function.

library/std/src/sync/once_lock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ impl<T> OnceLock<T> {
279279
///
280280
/// Many threads may call `get_or_init` concurrently with different
281281
/// initializing functions, but it is guaranteed that only one function
282-
/// will be executed.
282+
/// will be executed if the function doesn't panic.
283283
///
284284
/// # Panics
285285
///

0 commit comments

Comments
 (0)