Stabilize refcell_replace_swap feature, closes #43570
This commit is contained in:
parent
cee58fdc12
commit
70fa616a23
5 changed files with 3 additions and 5 deletions
|
|
@ -711,7 +711,6 @@ impl<T> RefCell<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(refcell_replace_swap)]
|
||||
/// use std::cell::RefCell;
|
||||
/// let cell = RefCell::new(5);
|
||||
/// let old_value = cell.replace_with(|&mut old| old + 1);
|
||||
|
|
@ -719,7 +718,7 @@ impl<T> RefCell<T> {
|
|||
/// assert_eq!(cell, RefCell::new(6));
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "refcell_replace_swap", issue="43570")]
|
||||
#[stable(feature = "refcell_replace_swap", since="1.35.0")]
|
||||
pub fn replace_with<F: FnOnce(&mut T) -> T>(&self, f: F) -> T {
|
||||
let mut_borrow = &mut *self.borrow_mut();
|
||||
let replacement = f(mut_borrow);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
#![feature(pattern)]
|
||||
#![feature(range_is_empty)]
|
||||
#![feature(raw)]
|
||||
#![feature(refcell_replace_swap)]
|
||||
#![feature(slice_patterns)]
|
||||
#![feature(sort_internals)]
|
||||
#![feature(specialization)]
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@
|
|||
#![feature(proc_macro_internals)]
|
||||
#![feature(optin_builtin_traits)]
|
||||
#![feature(range_is_empty)]
|
||||
#![feature(refcell_replace_swap)]
|
||||
#![feature(rustc_diagnostic_macros)]
|
||||
#![feature(rustc_attrs)]
|
||||
#![feature(slice_patterns)]
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ This API is completely unstable and subject to change.
|
|||
#![feature(crate_visibility_modifier)]
|
||||
#![feature(exhaustive_patterns)]
|
||||
#![feature(nll)]
|
||||
#![feature(refcell_replace_swap)]
|
||||
#![feature(rustc_diagnostic_macros)]
|
||||
#![feature(slice_patterns)]
|
||||
#![feature(never_type)]
|
||||
|
|
|
|||
|
|
@ -703,6 +703,8 @@ declare_features! (
|
|||
(accepted, extern_crate_self, "1.34.0", Some(56409), None),
|
||||
// support for arbitrary delimited token streams in non-macro attributes
|
||||
(accepted, unrestricted_attribute_tokens, "1.34.0", Some(55208), None),
|
||||
// add replace and swap functions to RefCell
|
||||
(accepted, refcell_replace_swap, "1.35.0", Some(43570), None),
|
||||
);
|
||||
|
||||
// If you change this, please modify `src/doc/unstable-book` as well. You must
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue