Skip to content

Commit

Permalink
Unrolled build for rust-lang#127599
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
rust-timer authored Jul 12, 2024
2 parents 5315cbe + ab56fe2 commit 19759c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library/core/src/cell/lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
/// # Examples
///
/// ```
/// #![feature(lazy_cell_consume)]
/// #![feature(lazy_cell_into_inner)]
///
/// use std::cell::LazyCell;
///
Expand All @@ -78,7 +78,7 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
/// assert_eq!(&*lazy, "HELLO, WORLD!");
/// assert_eq!(LazyCell::into_inner(lazy).ok(), Some("HELLO, WORLD!".to_string()));
/// ```
#[unstable(feature = "lazy_cell_consume", issue = "125623")]
#[unstable(feature = "lazy_cell_into_inner", issue = "125623")]
pub fn into_inner(this: Self) -> Result<T, F> {
match this.state.into_inner() {
State::Init(data) => Ok(data),
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/sync/lazy_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl<T, F: FnOnce() -> T> LazyLock<T, F> {
/// # Examples
///
/// ```
/// #![feature(lazy_cell_consume)]
/// #![feature(lazy_cell_into_inner)]
///
/// use std::sync::LazyLock;
///
Expand All @@ -118,7 +118,7 @@ impl<T, F: FnOnce() -> T> LazyLock<T, F> {
/// assert_eq!(&*lazy, "HELLO, WORLD!");
/// assert_eq!(LazyLock::into_inner(lazy).ok(), Some("HELLO, WORLD!".to_string()));
/// ```
#[unstable(feature = "lazy_cell_consume", issue = "125623")]
#[unstable(feature = "lazy_cell_into_inner", issue = "125623")]
pub fn into_inner(mut this: Self) -> Result<T, F> {
let state = this.once.state();
match state {
Expand Down

0 comments on commit 19759c4

Please sign in to comment.