stabilize option_get_or_insert_default

This commit is contained in:
Slanterns 2024-08-14 18:35:58 +08:00
parent 9859bf27fd
commit aec9116757
No known key found for this signature in database
GPG Key ID: 1AA37EE7FAAE433A
3 changed files with 1 additions and 5 deletions

View File

@ -9,7 +9,6 @@
#![feature(let_chains)]
#![feature(map_try_insert)]
#![feature(never_type)]
#![feature(option_get_or_insert_default)]
#![feature(round_char_boundary)]
#![feature(try_blocks)]
#![feature(yeet_expr)]

View File

@ -3,7 +3,6 @@
#![feature(iter_intersperse)]
#![feature(let_chains)]
#![feature(map_many_mut)]
#![feature(option_get_or_insert_default)]
#![feature(rustc_attrs)]
// tidy-alphabetical-end

View File

@ -1650,8 +1650,6 @@ impl<T> Option<T> {
/// # Examples
///
/// ```
/// #![feature(option_get_or_insert_default)]
///
/// let mut x = None;
///
/// {
@ -1664,7 +1662,7 @@ impl<T> Option<T> {
/// assert_eq!(x, Some(7));
/// ```
#[inline]
#[unstable(feature = "option_get_or_insert_default", issue = "82901")]
#[stable(feature = "option_get_or_insert_default", since = "CURRENT_RUSTC_VERSION")]
pub fn get_or_insert_default(&mut self) -> &mut T
where
T: Default,