Skip to content

Commit e76eb96

Browse files
authored
Rollup merge of #129087 - slanterns:option_get_or_insert_default, r=dtolnay
Stabilize `option_get_or_insert_default` Closes: #82901. `@rustbot` label: +T-libs-api r? libs-api
2 parents a3f76a2 + aec9116 commit e76eb96

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

compiler/rustc_session/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![feature(iter_intersperse)]
44
#![feature(let_chains)]
55
#![feature(map_many_mut)]
6-
#![feature(option_get_or_insert_default)]
76
#![feature(rustc_attrs)]
87
#![warn(unreachable_pub)]
98
// tidy-alphabetical-end

library/core/src/option.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1639,8 +1639,6 @@ impl<T> Option<T> {
16391639
/// # Examples
16401640
///
16411641
/// ```
1642-
/// #![feature(option_get_or_insert_default)]
1643-
///
16441642
/// let mut x = None;
16451643
///
16461644
/// {
@@ -1653,7 +1651,7 @@ impl<T> Option<T> {
16531651
/// assert_eq!(x, Some(7));
16541652
/// ```
16551653
#[inline]
1656-
#[unstable(feature = "option_get_or_insert_default", issue = "82901")]
1654+
#[stable(feature = "option_get_or_insert_default", since = "CURRENT_RUSTC_VERSION")]
16571655
pub fn get_or_insert_default(&mut self) -> &mut T
16581656
where
16591657
T: Default,

0 commit comments

Comments
 (0)