Rollup merge of #150016 - usamoi:stabilize-lazy-get, r=jhpratt

stabilize `lazy_get`

closes https://github.com/rust-lang/rust/issues/129333
FCP is finished in https://github.com/rust-lang/rust/issues/129333#issuecomment-3477510482

```@rustbot``` modify labels: +T-libs-api
This commit is contained in:
Jacob Pratt 2025-12-24 02:52:58 -05:00 committed by GitHub
commit 1c2dbcf33b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 58 additions and 75 deletions

View file

@ -165,7 +165,6 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
/// # Examples
///
/// ```
/// #![feature(lazy_get)]
/// use std::cell::LazyCell;
///
/// let mut lazy = LazyCell::new(|| 92);
@ -176,7 +175,7 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
/// assert_eq!(*lazy, 44);
/// ```
#[inline]
#[unstable(feature = "lazy_get", issue = "129333")]
#[stable(feature = "lazy_get", since = "CURRENT_RUSTC_VERSION")]
pub fn force_mut(this: &mut LazyCell<T, F>) -> &mut T {
#[cold]
/// # Safety
@ -264,8 +263,6 @@ impl<T, F> LazyCell<T, F> {
/// # Examples
///
/// ```
/// #![feature(lazy_get)]
///
/// use std::cell::LazyCell;
///
/// let mut lazy = LazyCell::new(|| 92);
@ -276,7 +273,7 @@ impl<T, F> LazyCell<T, F> {
/// assert_eq!(*lazy, 44);
/// ```
#[inline]
#[unstable(feature = "lazy_get", issue = "129333")]
#[stable(feature = "lazy_get", since = "CURRENT_RUSTC_VERSION")]
pub fn get_mut(this: &mut LazyCell<T, F>) -> Option<&mut T> {
let state = this.state.get_mut();
match state {
@ -291,8 +288,6 @@ impl<T, F> LazyCell<T, F> {
/// # Examples
///
/// ```
/// #![feature(lazy_get)]
///
/// use std::cell::LazyCell;
///
/// let lazy = LazyCell::new(|| 92);
@ -302,7 +297,7 @@ impl<T, F> LazyCell<T, F> {
/// assert_eq!(LazyCell::get(&lazy), Some(&92));
/// ```
#[inline]
#[unstable(feature = "lazy_get", issue = "129333")]
#[stable(feature = "lazy_get", since = "CURRENT_RUSTC_VERSION")]
pub fn get(this: &LazyCell<T, F>) -> Option<&T> {
// SAFETY:
// This is sound for the same reason as in `force`: once the state is

View file

@ -113,7 +113,6 @@
#![feature(internal_impls_macro)]
#![feature(ip)]
#![feature(is_ascii_octdigit)]
#![feature(lazy_get)]
#![feature(link_cfg)]
#![feature(offset_of_enum)]
#![feature(panic_internals)]

View file

@ -79,7 +79,6 @@
#![feature(iterator_try_collect)]
#![feature(iterator_try_reduce)]
#![feature(layout_for_ptr)]
#![feature(lazy_get)]
#![feature(maybe_uninit_fill)]
#![feature(maybe_uninit_uninit_array_transpose)]
#![feature(min_specialization)]

View file

@ -344,7 +344,6 @@
#![feature(hint_must_use)]
#![feature(int_from_ascii)]
#![feature(ip)]
#![feature(lazy_get)]
#![feature(maybe_uninit_array_assume_init)]
#![feature(panic_can_unwind)]
#![feature(panic_internals)]

View file

@ -172,7 +172,6 @@ impl<T, F: FnOnce() -> T> LazyLock<T, F> {
/// # Examples
///
/// ```
/// #![feature(lazy_get)]
/// use std::sync::LazyLock;
///
/// let mut lazy = LazyLock::new(|| 92);
@ -183,7 +182,7 @@ impl<T, F: FnOnce() -> T> LazyLock<T, F> {
/// assert_eq!(*lazy, 44);
/// ```
#[inline]
#[unstable(feature = "lazy_get", issue = "129333")]
#[stable(feature = "lazy_get", since = "CURRENT_RUSTC_VERSION")]
pub fn force_mut(this: &mut LazyLock<T, F>) -> &mut T {
#[cold]
/// # Safety
@ -279,8 +278,6 @@ impl<T, F> LazyLock<T, F> {
/// # Examples
///
/// ```
/// #![feature(lazy_get)]
///
/// use std::sync::LazyLock;
///
/// let mut lazy = LazyLock::new(|| 92);
@ -291,7 +288,7 @@ impl<T, F> LazyLock<T, F> {
/// assert_eq!(*lazy, 44);
/// ```
#[inline]
#[unstable(feature = "lazy_get", issue = "129333")]
#[stable(feature = "lazy_get", since = "CURRENT_RUSTC_VERSION")]
pub fn get_mut(this: &mut LazyLock<T, F>) -> Option<&mut T> {
// `state()` does not perform an atomic load, so prefer it over `is_complete()`.
let state = this.once.state();
@ -309,8 +306,6 @@ impl<T, F> LazyLock<T, F> {
/// # Examples
///
/// ```
/// #![feature(lazy_get)]
///
/// use std::sync::LazyLock;
///
/// let lazy = LazyLock::new(|| 92);
@ -320,7 +315,7 @@ impl<T, F> LazyLock<T, F> {
/// assert_eq!(LazyLock::get(&lazy), Some(&92));
/// ```
#[inline]
#[unstable(feature = "lazy_get", issue = "129333")]
#[stable(feature = "lazy_get", since = "CURRENT_RUSTC_VERSION")]
#[rustc_should_not_be_called_on_const_items]
pub fn get(this: &LazyLock<T, F>) -> Option<&T> {
if this.once.is_completed() {

View file

@ -1,4 +1,3 @@
#![feature(lazy_get)]
#![feature(mapped_lock_guards)]
#![feature(mpmc_channel)]
#![feature(once_cell_try)]

View file

@ -4,7 +4,6 @@
#![feature(sync_unsafe_cell)]
#![feature(once_cell_try_insert)]
#![feature(once_cell_try)]
#![feature(lazy_get)]
use std::cell::{Cell, RefCell, SyncUnsafeCell, UnsafeCell};
use std::cell::{LazyCell, OnceCell};

View file

@ -1,5 +1,5 @@
warning: mutation of an interior mutable `const` item with call to `force`
--> $DIR/const-item-interior-mutations-const-cell.rs:16:13
--> $DIR/const-item-interior-mutations-const-cell.rs:15:13
|
LL | let _ = LazyCell::force(&A);
| ^^^^^^^^^^^^^^^^^-^
@ -17,7 +17,7 @@ LL + static A: LazyCell<i32> = LazyCell::new(|| 0);
|
warning: mutation of an interior mutable `const` item with call to `set`
--> $DIR/const-item-interior-mutations-const-cell.rs:23:13
--> $DIR/const-item-interior-mutations-const-cell.rs:22:13
|
LL | let _ = A.set(10);
| -^^^^^^^^
@ -34,7 +34,7 @@ LL + static A: OnceCell<i32> = OnceCell::new();
|
warning: mutation of an interior mutable `const` item with call to `try_insert`
--> $DIR/const-item-interior-mutations-const-cell.rs:26:13
--> $DIR/const-item-interior-mutations-const-cell.rs:25:13
|
LL | let _ = A.try_insert(20);
| -^^^^^^^^^^^^^^^
@ -51,7 +51,7 @@ LL + static A: OnceCell<i32> = OnceCell::new();
|
warning: mutation of an interior mutable `const` item with call to `get_or_init`
--> $DIR/const-item-interior-mutations-const-cell.rs:29:13
--> $DIR/const-item-interior-mutations-const-cell.rs:28:13
|
LL | let _ = A.get_or_init(|| 30);
| -^^^^^^^^^^^^^^^^^^^
@ -68,7 +68,7 @@ LL + static A: OnceCell<i32> = OnceCell::new();
|
warning: mutation of an interior mutable `const` item with call to `get_or_try_init`
--> $DIR/const-item-interior-mutations-const-cell.rs:32:13
--> $DIR/const-item-interior-mutations-const-cell.rs:31:13
|
LL | let _ = A.get_or_try_init(|| Ok::<_, ()>(40));
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -85,7 +85,7 @@ LL + static A: OnceCell<i32> = OnceCell::new();
|
warning: mutation of an interior mutable `const` item with call to `set`
--> $DIR/const-item-interior-mutations-const-cell.rs:39:13
--> $DIR/const-item-interior-mutations-const-cell.rs:38:13
|
LL | let _ = A.set(1);
| -^^^^^^^
@ -102,7 +102,7 @@ LL + static A: Cell<i32> = Cell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `swap`
--> $DIR/const-item-interior-mutations-const-cell.rs:42:13
--> $DIR/const-item-interior-mutations-const-cell.rs:41:13
|
LL | let _ = A.swap(&A);
| -^^^^^^^^^
@ -119,7 +119,7 @@ LL + static A: Cell<i32> = Cell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `replace`
--> $DIR/const-item-interior-mutations-const-cell.rs:45:13
--> $DIR/const-item-interior-mutations-const-cell.rs:44:13
|
LL | let _ = A.replace(2);
| -^^^^^^^^^^^
@ -136,7 +136,7 @@ LL + static A: Cell<i32> = Cell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `get`
--> $DIR/const-item-interior-mutations-const-cell.rs:48:13
--> $DIR/const-item-interior-mutations-const-cell.rs:47:13
|
LL | let _ = A.get();
| -^^^^^^
@ -153,7 +153,7 @@ LL + static A: Cell<i32> = Cell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `update`
--> $DIR/const-item-interior-mutations-const-cell.rs:51:13
--> $DIR/const-item-interior-mutations-const-cell.rs:50:13
|
LL | let _ = A.update(|x| x + 1);
| -^^^^^^^^^^^^^^^^^^
@ -170,7 +170,7 @@ LL + static A: Cell<i32> = Cell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `replace`
--> $DIR/const-item-interior-mutations-const-cell.rs:58:13
--> $DIR/const-item-interior-mutations-const-cell.rs:57:13
|
LL | let _ = A.replace(1);
| -^^^^^^^^^^^
@ -187,7 +187,7 @@ LL + static A: RefCell<i32> = RefCell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `replace_with`
--> $DIR/const-item-interior-mutations-const-cell.rs:61:13
--> $DIR/const-item-interior-mutations-const-cell.rs:60:13
|
LL | let _ = A.replace_with(|x| *x + 2);
| -^^^^^^^^^^^^^^^^^^^^^^^^^
@ -204,7 +204,7 @@ LL + static A: RefCell<i32> = RefCell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `swap`
--> $DIR/const-item-interior-mutations-const-cell.rs:64:13
--> $DIR/const-item-interior-mutations-const-cell.rs:63:13
|
LL | let _ = A.swap(&A);
| -^^^^^^^^^
@ -221,7 +221,7 @@ LL + static A: RefCell<i32> = RefCell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `borrow`
--> $DIR/const-item-interior-mutations-const-cell.rs:67:13
--> $DIR/const-item-interior-mutations-const-cell.rs:66:13
|
LL | let _ = A.borrow();
| -^^^^^^^^^
@ -238,7 +238,7 @@ LL + static A: RefCell<i32> = RefCell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `try_borrow`
--> $DIR/const-item-interior-mutations-const-cell.rs:70:13
--> $DIR/const-item-interior-mutations-const-cell.rs:69:13
|
LL | let _ = A.try_borrow();
| -^^^^^^^^^^^^^
@ -255,7 +255,7 @@ LL + static A: RefCell<i32> = RefCell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `borrow_mut`
--> $DIR/const-item-interior-mutations-const-cell.rs:73:13
--> $DIR/const-item-interior-mutations-const-cell.rs:72:13
|
LL | let _ = A.borrow_mut();
| -^^^^^^^^^^^^^
@ -272,7 +272,7 @@ LL + static A: RefCell<i32> = RefCell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `try_borrow_mut`
--> $DIR/const-item-interior-mutations-const-cell.rs:76:13
--> $DIR/const-item-interior-mutations-const-cell.rs:75:13
|
LL | let _ = A.try_borrow_mut();
| -^^^^^^^^^^^^^^^^^
@ -289,7 +289,7 @@ LL + static A: RefCell<i32> = RefCell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `replace`
--> $DIR/const-item-interior-mutations-const-cell.rs:83:22
--> $DIR/const-item-interior-mutations-const-cell.rs:82:22
|
LL | let _ = unsafe { A.replace(1) };
| -^^^^^^^^^^^
@ -306,7 +306,7 @@ LL + static A: UnsafeCell<i32> = UnsafeCell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `get`
--> $DIR/const-item-interior-mutations-const-cell.rs:86:13
--> $DIR/const-item-interior-mutations-const-cell.rs:85:13
|
LL | let _ = A.get();
| -^^^^^^
@ -323,7 +323,7 @@ LL + static A: UnsafeCell<i32> = UnsafeCell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `as_ref_unchecked`
--> $DIR/const-item-interior-mutations-const-cell.rs:90:17
--> $DIR/const-item-interior-mutations-const-cell.rs:89:17
|
LL | let _ = A.as_ref_unchecked();
| -^^^^^^^^^^^^^^^^^^^
@ -340,7 +340,7 @@ LL + static A: UnsafeCell<i32> = UnsafeCell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `as_mut_unchecked`
--> $DIR/const-item-interior-mutations-const-cell.rs:93:17
--> $DIR/const-item-interior-mutations-const-cell.rs:92:17
|
LL | let _ = A.as_mut_unchecked();
| -^^^^^^^^^^^^^^^^^^^
@ -357,7 +357,7 @@ LL + static A: UnsafeCell<i32> = UnsafeCell::new(0);
|
warning: mutation of an interior mutable `const` item with call to `get`
--> $DIR/const-item-interior-mutations-const-cell.rs:101:13
--> $DIR/const-item-interior-mutations-const-cell.rs:100:13
|
LL | let _ = A.get();
| -^^^^^^

View file

@ -6,7 +6,6 @@
#![feature(lock_value_accessors)]
#![feature(once_cell_try_insert)]
#![feature(once_cell_try)]
#![feature(lazy_get)]
use std::sync::{Condvar, LazyLock, Mutex, Once, OnceLock, RwLock};
use std::time::Duration;

View file

@ -6,7 +6,6 @@
#![feature(lock_value_accessors)]
#![feature(once_cell_try_insert)]
#![feature(once_cell_try)]
#![feature(lazy_get)]
use std::sync::{Condvar, LazyLock, Mutex, Once, OnceLock, RwLock};
use std::time::Duration;

View file

@ -1,5 +1,5 @@
warning: mutation of an interior mutable `const` item with call to `set`
--> $DIR/const-item-interior-mutations-const.rs:17:14
--> $DIR/const-item-interior-mutations-const.rs:16:14
|
LL | let _a = A.set(1);
| -^^^^^^^
@ -17,7 +17,7 @@ LL + static A: Mutex<i32> = Mutex::new(0);
|
warning: mutation of an interior mutable `const` item with call to `replace`
--> $DIR/const-item-interior-mutations-const.rs:20:14
--> $DIR/const-item-interior-mutations-const.rs:19:14
|
LL | let _a = A.replace(2);
| -^^^^^^^^^^^
@ -34,7 +34,7 @@ LL + static A: Mutex<i32> = Mutex::new(0);
|
warning: mutation of an interior mutable `const` item with call to `lock`
--> $DIR/const-item-interior-mutations-const.rs:23:10
--> $DIR/const-item-interior-mutations-const.rs:22:10
|
LL | drop(A.lock());
| -^^^^^^^
@ -51,7 +51,7 @@ LL + static A: Mutex<i32> = Mutex::new(0);
|
warning: mutation of an interior mutable `const` item with call to `try_lock`
--> $DIR/const-item-interior-mutations-const.rs:26:10
--> $DIR/const-item-interior-mutations-const.rs:25:10
|
LL | drop(A.try_lock());
| -^^^^^^^^^^^
@ -68,7 +68,7 @@ LL + static A: Mutex<i32> = Mutex::new(0);
|
warning: mutation of an interior mutable `const` item with call to `clear_poison`
--> $DIR/const-item-interior-mutations-const.rs:29:14
--> $DIR/const-item-interior-mutations-const.rs:28:14
|
LL | let _a = A.clear_poison();
| -^^^^^^^^^^^^^^^
@ -85,7 +85,7 @@ LL + static A: Mutex<i32> = Mutex::new(0);
|
warning: mutation of an interior mutable `const` item with call to `call_once`
--> $DIR/const-item-interior-mutations-const.rs:36:14
--> $DIR/const-item-interior-mutations-const.rs:35:14
|
LL | let _a = A.call_once(|| {});
| -^^^^^^^^^^^^^^^^^
@ -102,7 +102,7 @@ LL + static A: Once = Once::new();
|
warning: mutation of an interior mutable `const` item with call to `call_once_force`
--> $DIR/const-item-interior-mutations-const.rs:39:14
--> $DIR/const-item-interior-mutations-const.rs:38:14
|
LL | let _a = A.call_once_force(|_| {});
| -^^^^^^^^^^^^^^^^^^^^^^^^
@ -119,7 +119,7 @@ LL + static A: Once = Once::new();
|
warning: mutation of an interior mutable `const` item with call to `wait`
--> $DIR/const-item-interior-mutations-const.rs:42:14
--> $DIR/const-item-interior-mutations-const.rs:41:14
|
LL | let _a = A.wait();
| -^^^^^^^
@ -136,7 +136,7 @@ LL + static A: Once = Once::new();
|
warning: mutation of an interior mutable `const` item with call to `wait_force`
--> $DIR/const-item-interior-mutations-const.rs:45:14
--> $DIR/const-item-interior-mutations-const.rs:44:14
|
LL | let _a = A.wait_force();
| -^^^^^^^^^^^^^
@ -153,7 +153,7 @@ LL + static A: Once = Once::new();
|
warning: mutation of an interior mutable `const` item with call to `set`
--> $DIR/const-item-interior-mutations-const.rs:52:14
--> $DIR/const-item-interior-mutations-const.rs:51:14
|
LL | let _a = A.set(1);
| -^^^^^^^
@ -170,7 +170,7 @@ LL + static A: RwLock<i32> = RwLock::new(0);
|
warning: mutation of an interior mutable `const` item with call to `replace`
--> $DIR/const-item-interior-mutations-const.rs:55:14
--> $DIR/const-item-interior-mutations-const.rs:54:14
|
LL | let _a = A.replace(2);
| -^^^^^^^^^^^
@ -187,7 +187,7 @@ LL + static A: RwLock<i32> = RwLock::new(0);
|
warning: mutation of an interior mutable `const` item with call to `read`
--> $DIR/const-item-interior-mutations-const.rs:58:10
--> $DIR/const-item-interior-mutations-const.rs:57:10
|
LL | drop(A.read());
| -^^^^^^^
@ -204,7 +204,7 @@ LL + static A: RwLock<i32> = RwLock::new(0);
|
warning: mutation of an interior mutable `const` item with call to `try_read`
--> $DIR/const-item-interior-mutations-const.rs:61:10
--> $DIR/const-item-interior-mutations-const.rs:60:10
|
LL | drop(A.try_read());
| -^^^^^^^^^^^
@ -221,7 +221,7 @@ LL + static A: RwLock<i32> = RwLock::new(0);
|
warning: mutation of an interior mutable `const` item with call to `write`
--> $DIR/const-item-interior-mutations-const.rs:64:10
--> $DIR/const-item-interior-mutations-const.rs:63:10
|
LL | drop(A.write());
| -^^^^^^^^
@ -238,7 +238,7 @@ LL + static A: RwLock<i32> = RwLock::new(0);
|
warning: mutation of an interior mutable `const` item with call to `try_write`
--> $DIR/const-item-interior-mutations-const.rs:67:10
--> $DIR/const-item-interior-mutations-const.rs:66:10
|
LL | drop(A.try_write());
| -^^^^^^^^^^^^
@ -255,7 +255,7 @@ LL + static A: RwLock<i32> = RwLock::new(0);
|
warning: mutation of an interior mutable `const` item with call to `force`
--> $DIR/const-item-interior-mutations-const.rs:74:14
--> $DIR/const-item-interior-mutations-const.rs:73:14
|
LL | let _a = LazyLock::force(&A);
| ^^^^^^^^^^^^^^^^^-^
@ -272,7 +272,7 @@ LL + static A: LazyLock<i32> = LazyLock::new(|| 0);
|
warning: mutation of an interior mutable `const` item with call to `get`
--> $DIR/const-item-interior-mutations-const.rs:77:14
--> $DIR/const-item-interior-mutations-const.rs:76:14
|
LL | let _a = LazyLock::get(&A);
| ^^^^^^^^^^^^^^^-^
@ -289,7 +289,7 @@ LL + static A: LazyLock<i32> = LazyLock::new(|| 0);
|
warning: mutation of an interior mutable `const` item with call to `get`
--> $DIR/const-item-interior-mutations-const.rs:84:14
--> $DIR/const-item-interior-mutations-const.rs:83:14
|
LL | let _a = A.get();
| -^^^^^^
@ -306,7 +306,7 @@ LL + static A: OnceLock<i32> = OnceLock::new();
|
warning: mutation of an interior mutable `const` item with call to `wait`
--> $DIR/const-item-interior-mutations-const.rs:87:14
--> $DIR/const-item-interior-mutations-const.rs:86:14
|
LL | let _a = A.wait();
| -^^^^^^^
@ -323,7 +323,7 @@ LL + static A: OnceLock<i32> = OnceLock::new();
|
warning: mutation of an interior mutable `const` item with call to `set`
--> $DIR/const-item-interior-mutations-const.rs:90:14
--> $DIR/const-item-interior-mutations-const.rs:89:14
|
LL | let _a = A.set(10);
| -^^^^^^^^
@ -340,7 +340,7 @@ LL + static A: OnceLock<i32> = OnceLock::new();
|
warning: mutation of an interior mutable `const` item with call to `try_insert`
--> $DIR/const-item-interior-mutations-const.rs:93:14
--> $DIR/const-item-interior-mutations-const.rs:92:14
|
LL | let _a = A.try_insert(20);
| -^^^^^^^^^^^^^^^
@ -357,7 +357,7 @@ LL + static A: OnceLock<i32> = OnceLock::new();
|
warning: mutation of an interior mutable `const` item with call to `get_or_init`
--> $DIR/const-item-interior-mutations-const.rs:96:14
--> $DIR/const-item-interior-mutations-const.rs:95:14
|
LL | let _a = A.get_or_init(|| 30);
| -^^^^^^^^^^^^^^^^^^^
@ -374,7 +374,7 @@ LL + static A: OnceLock<i32> = OnceLock::new();
|
warning: mutation of an interior mutable `const` item with call to `get_or_try_init`
--> $DIR/const-item-interior-mutations-const.rs:99:14
--> $DIR/const-item-interior-mutations-const.rs:98:14
|
LL | let _a = A.get_or_try_init(|| Ok::<_, ()>(40));
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -391,7 +391,7 @@ LL + static A: OnceLock<i32> = OnceLock::new();
|
warning: mutation of an interior mutable `const` item with call to `wait`
--> $DIR/const-item-interior-mutations-const.rs:109:14
--> $DIR/const-item-interior-mutations-const.rs:108:14
|
LL | let _a = A.wait(guard);
| -^^^^^^^^^^^^
@ -408,7 +408,7 @@ LL + static A: Condvar = Condvar::new();
|
warning: mutation of an interior mutable `const` item with call to `wait_while`
--> $DIR/const-item-interior-mutations-const.rs:114:14
--> $DIR/const-item-interior-mutations-const.rs:113:14
|
LL | let _a = A.wait_while(guard, |x| *x == 0);
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -425,7 +425,7 @@ LL + static A: Condvar = Condvar::new();
|
warning: mutation of an interior mutable `const` item with call to `wait_timeout_ms`
--> $DIR/const-item-interior-mutations-const.rs:119:14
--> $DIR/const-item-interior-mutations-const.rs:118:14
|
LL | let _a = A.wait_timeout_ms(guard, 10);
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -442,7 +442,7 @@ LL + static A: Condvar = Condvar::new();
|
warning: mutation of an interior mutable `const` item with call to `wait_timeout`
--> $DIR/const-item-interior-mutations-const.rs:124:14
--> $DIR/const-item-interior-mutations-const.rs:123:14
|
LL | let _a = A.wait_timeout(guard, Duration::from_millis(10));
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -459,7 +459,7 @@ LL + static A: Condvar = Condvar::new();
|
warning: mutation of an interior mutable `const` item with call to `wait_timeout_while`
--> $DIR/const-item-interior-mutations-const.rs:129:14
--> $DIR/const-item-interior-mutations-const.rs:128:14
|
LL | let _a = A.wait_timeout_while(guard, Duration::from_millis(10), |x| *x == 0);
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -476,7 +476,7 @@ LL + static A: Condvar = Condvar::new();
|
warning: mutation of an interior mutable `const` item with call to `notify_one`
--> $DIR/const-item-interior-mutations-const.rs:132:14
--> $DIR/const-item-interior-mutations-const.rs:131:14
|
LL | let _a = A.notify_one();
| -^^^^^^^^^^^^^
@ -493,7 +493,7 @@ LL + static A: Condvar = Condvar::new();
|
warning: mutation of an interior mutable `const` item with call to `notify_all`
--> $DIR/const-item-interior-mutations-const.rs:135:14
--> $DIR/const-item-interior-mutations-const.rs:134:14
|
LL | let _a = A.notify_all();
| -^^^^^^^^^^^^^