Skip to content

Commit 9d198db

Browse files
authored
Rollup merge of #59581 - jmcomets:stabilize-refcell_replace_swap, r=Centril
Stabilize refcell_replace_swap feature Please be kind, this is my first time contributing. 😄 I noticed #43570 only needs stabilizing (and I need it for a side project I'm working on), so I followed the [guide](https://rust-lang.github.io/rustc-guide/stabilization_guide.html#stabilization-pr) to move things forward. I'm happy to amend things if needed, let me know!
2 parents 1909a03 + c789a53 commit 9d198db

File tree

4 files changed

+1
-7
lines changed

4 files changed

+1
-7
lines changed

src/libcore/cell.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -702,24 +702,21 @@ impl<T> RefCell<T> {
702702
/// Replaces the wrapped value with a new one computed from `f`, returning
703703
/// the old value, without deinitializing either one.
704704
///
705-
/// This function corresponds to [`std::mem::replace`](../mem/fn.replace.html).
706-
///
707705
/// # Panics
708706
///
709707
/// Panics if the value is currently borrowed.
710708
///
711709
/// # Examples
712710
///
713711
/// ```
714-
/// #![feature(refcell_replace_swap)]
715712
/// use std::cell::RefCell;
716713
/// let cell = RefCell::new(5);
717714
/// let old_value = cell.replace_with(|&mut old| old + 1);
718715
/// assert_eq!(old_value, 5);
719716
/// assert_eq!(cell, RefCell::new(6));
720717
/// ```
721718
#[inline]
722-
#[unstable(feature = "refcell_replace_swap", issue="43570")]
719+
#[stable(feature = "refcell_replace_swap", since="1.35.0")]
723720
pub fn replace_with<F: FnOnce(&mut T) -> T>(&self, f: F) -> T {
724721
let mut_borrow = &mut *self.borrow_mut();
725722
let replacement = f(mut_borrow);

src/libcore/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#![feature(pattern)]
1717
#![feature(range_is_empty)]
1818
#![feature(raw)]
19-
#![feature(refcell_replace_swap)]
2019
#![feature(slice_patterns)]
2120
#![feature(sort_internals)]
2221
#![feature(specialization)]

src/librustc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#![feature(proc_macro_internals)]
4646
#![feature(optin_builtin_traits)]
4747
#![feature(range_is_empty)]
48-
#![feature(refcell_replace_swap)]
4948
#![feature(rustc_diagnostic_macros)]
5049
#![feature(rustc_attrs)]
5150
#![feature(slice_patterns)]

src/librustc_typeck/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ This API is completely unstable and subject to change.
6464
#![feature(crate_visibility_modifier)]
6565
#![feature(exhaustive_patterns)]
6666
#![feature(nll)]
67-
#![feature(refcell_replace_swap)]
6867
#![feature(rustc_diagnostic_macros)]
6968
#![feature(slice_patterns)]
7069
#![feature(never_type)]

0 commit comments

Comments
 (0)