mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-24 22:50:25 +03:00
Rollup merge of #54904 - Kerollmops:stabilize-option-replace, r=Centril
Fixes #47311. r? @nrc
This commit is contained in:
@@ -867,8 +867,6 @@ pub fn take(&mut self) -> 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 @@ pub fn take(&mut self) -> Option<T> {
|
||||
/// assert_eq!(old, None);
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "option_replace", issue = "51998")]
|
||||
#[stable(feature = "option_replace", since = "1.31.0")]
|
||||
pub fn replace(&mut self, value: T) -> Option<T> {
|
||||
mem::replace(self, Some(value))
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#![feature(reverse_bits)]
|
||||
#![feature(inner_deref)]
|
||||
#![feature(slice_internals)]
|
||||
#![feature(option_replace)]
|
||||
#![feature(slice_partition_dedup)]
|
||||
#![feature(copy_within)]
|
||||
|
||||
|
||||
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user