Skip to content

Commit f937ef1

Browse files
authored
Rollup merge of rust-lang#127599 - tgross35:lazy_cell_consume-rename, r=workingjubilee
Rename `lazy_cell_consume` to `lazy_cell_into_inner` Name this something that is less confusable with an atomic consume API for `{Lazy,Once}Lock`.
2 parents fde7fd2 + b71b538 commit f937ef1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/src/cell/lazy.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
6767
/// # Examples
6868
///
6969
/// ```
70-
/// #![feature(lazy_cell_consume)]
70+
/// #![feature(lazy_cell_into_inner)]
7171
///
7272
/// use std::cell::LazyCell;
7373
///
@@ -78,7 +78,7 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
7878
/// assert_eq!(&*lazy, "HELLO, WORLD!");
7979
/// assert_eq!(LazyCell::into_inner(lazy).ok(), Some("HELLO, WORLD!".to_string()));
8080
/// ```
81-
#[unstable(feature = "lazy_cell_consume", issue = "125623")]
81+
#[unstable(feature = "lazy_cell_into_inner", issue = "125623")]
8282
pub fn into_inner(this: Self) -> Result<T, F> {
8383
match this.state.into_inner() {
8484
State::Init(data) => Ok(data),

std/src/sync/lazy_lock.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl<T, F: FnOnce() -> T> LazyLock<T, F> {
107107
/// # Examples
108108
///
109109
/// ```
110-
/// #![feature(lazy_cell_consume)]
110+
/// #![feature(lazy_cell_into_inner)]
111111
///
112112
/// use std::sync::LazyLock;
113113
///
@@ -118,7 +118,7 @@ impl<T, F: FnOnce() -> T> LazyLock<T, F> {
118118
/// assert_eq!(&*lazy, "HELLO, WORLD!");
119119
/// assert_eq!(LazyLock::into_inner(lazy).ok(), Some("HELLO, WORLD!".to_string()));
120120
/// ```
121-
#[unstable(feature = "lazy_cell_consume", issue = "125623")]
121+
#[unstable(feature = "lazy_cell_into_inner", issue = "125623")]
122122
pub fn into_inner(mut this: Self) -> Result<T, F> {
123123
let state = this.once.state();
124124
match state {

0 commit comments

Comments
 (0)