Skip to content

Commit c3241b5

Browse files
authored
Rollup merge of rust-lang#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 rust-lang#43570
2 parents 8de8196 + 19775f7 commit c3241b5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/libcore/cell.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,15 +584,14 @@ impl<T> RefCell<T> {
584584
/// # Examples
585585
///
586586
/// ```
587-
/// #![feature(refcell_replace_swap)]
588587
/// use std::cell::RefCell;
589588
/// let cell = RefCell::new(5);
590589
/// let old_value = cell.replace(6);
591590
/// assert_eq!(old_value, 5);
592591
/// assert_eq!(cell, RefCell::new(6));
593592
/// ```
594593
#[inline]
595-
#[unstable(feature = "refcell_replace_swap", issue="43570")]
594+
#[stable(feature = "refcell_replace", since="1.24.0")]
596595
pub fn replace(&self, t: T) -> T {
597596
mem::replace(&mut *self.borrow_mut(), t)
598597
}
@@ -636,7 +635,6 @@ impl<T> RefCell<T> {
636635
/// # Examples
637636
///
638637
/// ```
639-
/// #![feature(refcell_replace_swap)]
640638
/// use std::cell::RefCell;
641639
/// let c = RefCell::new(5);
642640
/// let d = RefCell::new(6);
@@ -645,7 +643,7 @@ impl<T> RefCell<T> {
645643
/// assert_eq!(d, RefCell::new(5));
646644
/// ```
647645
#[inline]
648-
#[unstable(feature = "refcell_replace_swap", issue="43570")]
646+
#[stable(feature = "refcell_swap", since="1.24.0")]
649647
pub fn swap(&self, other: &Self) {
650648
mem::swap(&mut *self.borrow_mut(), &mut *other.borrow_mut())
651649
}

0 commit comments

Comments
 (0)