diff --git a/compiler/rustc_session/src/lib.rs b/compiler/rustc_session/src/lib.rs index 7e059a88c2790..1ee5ac8b747e1 100644 --- a/compiler/rustc_session/src/lib.rs +++ b/compiler/rustc_session/src/lib.rs @@ -1,9 +1,9 @@ // tidy-alphabetical-start #![allow(internal_features)] +#![cfg_attr(bootstrap, feature(option_get_or_insert_default))] #![feature(iter_intersperse)] #![feature(let_chains)] #![feature(map_many_mut)] -#![feature(option_get_or_insert_default)] #![feature(rustc_attrs)] #![warn(unreachable_pub)] // tidy-alphabetical-end diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 30c667e2494b2..a66ef16e3ca36 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -1639,8 +1639,6 @@ impl Option { /// # Examples /// /// ``` - /// #![feature(option_get_or_insert_default)] - /// /// let mut x = None; /// /// { @@ -1653,7 +1651,7 @@ impl Option { /// 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,