Stabilize the Option::replace method

This commit is contained in:
Clément Renault 2018-10-08 10:06:45 +02:00
parent ef5c00d0ca
commit 8c01c225ce
3 changed files with 1 additions and 5 deletions

View file

@ -867,8 +867,6 @@ impl<T> Option<T> {
/// # Examples
///
/// ```
/// #![feature(option_replace)]
///
/// let mut x = Some(2);
/// let old = x.replace(5);
/// assert_eq!(x, Some(5));
@ -880,7 +878,7 @@ impl<T> Option<T> {
/// assert_eq!(old, None);
/// ```
#[inline]
#[unstable(feature = "option_replace", issue = "51998")]
#[stable(feature = "option_replace", since = "1.30.0")]
pub fn replace(&mut self, value: T) -> Option<T> {
mem::replace(self, Some(value))
}

View file

@ -39,7 +39,6 @@
#![feature(reverse_bits)]
#![feature(inner_deref)]
#![feature(slice_internals)]
#![feature(option_replace)]
#![feature(slice_partition_dedup)]
#![feature(copy_within)]

View file

@ -21,7 +21,6 @@
#![feature(box_syntax)]
#![cfg_attr(unix, feature(libc))]
#![feature(nll)]
#![feature(option_replace)]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(slice_sort_by_cached_key)]