diff options
| author | kennytm <kennytm@gmail.com> | 2017-12-20 21:21:51 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-20 21:21:51 +0800 |
| commit | c3241b504f312b9947cd2b4c11e7f4fe46dcf697 (patch) | |
| tree | c95de107210e1aed7bea53fba1ca46b6613bc84c | |
| parent | 8de81966cdc68541fcef8cc23f70096c29c8ae4c (diff) | |
| parent | 19775f73a39c73298c3507fe861bec8dae4e4c1f (diff) | |
| download | rust-c3241b504f312b9947cd2b4c11e7f4fe46dcf697.tar.gz rust-c3241b504f312b9947cd2b4c11e7f4fe46dcf697.zip | |
Rollup merge of #46517 - notriddle:patch-2, r=BurntSushi
Stablize RefCell::{replace, swap}
RefCell::replace_with is not stablized in this PR, since it wasn't part of the RFC.
CC #43570
| -rw-r--r-- | src/libcore/cell.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 93cfc845b1f..c5375d1e00c 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -584,7 +584,6 @@ impl<T> RefCell<T> { /// # Examples /// /// ``` - /// #![feature(refcell_replace_swap)] /// use std::cell::RefCell; /// let cell = RefCell::new(5); /// let old_value = cell.replace(6); @@ -592,7 +591,7 @@ impl<T> RefCell<T> { /// assert_eq!(cell, RefCell::new(6)); /// ``` #[inline] - #[unstable(feature = "refcell_replace_swap", issue="43570")] + #[stable(feature = "refcell_replace", since="1.24.0")] pub fn replace(&self, t: T) -> T { mem::replace(&mut *self.borrow_mut(), t) } @@ -636,7 +635,6 @@ impl<T> RefCell<T> { /// # Examples /// /// ``` - /// #![feature(refcell_replace_swap)] /// use std::cell::RefCell; /// let c = RefCell::new(5); /// let d = RefCell::new(6); @@ -645,7 +643,7 @@ impl<T> RefCell<T> { /// assert_eq!(d, RefCell::new(5)); /// ``` #[inline] - #[unstable(feature = "refcell_replace_swap", issue="43570")] + #[stable(feature = "refcell_swap", since="1.24.0")] pub fn swap(&self, other: &Self) { mem::swap(&mut *self.borrow_mut(), &mut *other.borrow_mut()) } |
