diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-03-31 19:19:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-31 19:19:53 +0200 |
| commit | 9d198db339aa3b97a3f75c8091ba512a83981d0e (patch) | |
| tree | 79bde420ba1ad99f2e1f5da9eda309db58f6602c | |
| parent | 1909a0303a92c0938e9f57b1c32148cfa2a4ff71 (diff) | |
| parent | c789a539a29b411b89411f8660d6ed2c2c4c4bbb (diff) | |
| download | rust-9d198db339aa3b97a3f75c8091ba512a83981d0e.tar.gz rust-9d198db339aa3b97a3f75c8091ba512a83981d0e.zip | |
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. :smile: 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!
| -rw-r--r-- | src/libcore/cell.rs | 5 | ||||
| -rw-r--r-- | src/libcore/tests/lib.rs | 1 | ||||
| -rw-r--r-- | src/librustc/lib.rs | 1 | ||||
| -rw-r--r-- | src/librustc_typeck/lib.rs | 1 |
4 files changed, 1 insertions, 7 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 3b888244341..80dd51acc9e 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -702,8 +702,6 @@ impl<T> RefCell<T> { /// Replaces the wrapped value with a new one computed from `f`, returning /// the old value, without deinitializing either one. /// - /// This function corresponds to [`std::mem::replace`](../mem/fn.replace.html). - /// /// # Panics /// /// Panics if the value is currently borrowed. @@ -711,7 +709,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 +716,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); diff --git a/src/libcore/tests/lib.rs b/src/libcore/tests/lib.rs index 2ed25a34102..5e0dbb7ab2f 100644 --- a/src/libcore/tests/lib.rs +++ b/src/libcore/tests/lib.rs @@ -16,7 +16,6 @@ #![feature(pattern)] #![feature(range_is_empty)] #![feature(raw)] -#![feature(refcell_replace_swap)] #![feature(slice_patterns)] #![feature(sort_internals)] #![feature(specialization)] diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index e905c368851..b87343b43c9 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -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)] diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index cc90044573c..1fa16352b86 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -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)] |
