Skip to content

Commit 0c01f5d

Browse files
committed
Stabilize the cell_update feature
Included API: impl<T: Copy> Cell<T> { pub fn update(&self, f: impl FnOnce(T) -> T); } Closes: rust-lang#50186
1 parent 0cce469 commit 0c01f5d

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

core/src/cell.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -549,16 +549,14 @@ impl<T: Copy> Cell<T> {
549549
/// # Examples
550550
///
551551
/// ```
552-
/// #![feature(cell_update)]
553-
///
554552
/// use std::cell::Cell;
555553
///
556554
/// let c = Cell::new(5);
557555
/// c.update(|x| x + 1);
558556
/// assert_eq!(c.get(), 6);
559557
/// ```
560558
#[inline]
561-
#[unstable(feature = "cell_update", issue = "50186")]
559+
#[stable(feature = "cell_update", since = "CURRENT_RUSTC_VERSION")]
562560
pub fn update(&self, f: impl FnOnce(T) -> T) {
563561
let old = self.get();
564562
self.set(f(old));

coretests/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#![feature(async_iterator)]
1313
#![feature(bigint_helper_methods)]
1414
#![feature(bstr)]
15-
#![feature(cell_update)]
1615
#![feature(char_max_len)]
1716
#![feature(clone_to_uninit)]
1817
#![feature(const_eval_select)]

0 commit comments

Comments
 (0)