diff --git a/src/libcore/option.rs b/src/libcore/option.rs index e8483875c97e5..ce8ef6cc5f40a 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -203,7 +203,7 @@ impl Option { /// /// [`None`]: #variant.None #[must_use = "if you intended to assert that this doesn't have a value, consider \ - `.and_then(|| panic!(\"`Option` had a value when expected `None`\"))` instead"] + `.unwrap_none()` instead"] #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn is_none(&self) -> bool { @@ -1066,8 +1066,6 @@ impl Option { /// # Examples /// /// ``` - /// #![feature(option_expect_none)] - /// /// use std::collections::HashMap; /// let mut squares = HashMap::new(); /// for i in -10..=10 { @@ -1077,8 +1075,6 @@ impl Option { /// ``` /// /// ```{.should_panic} - /// #![feature(option_expect_none)] - /// /// use std::collections::HashMap; /// let mut sqrts = HashMap::new(); /// for i in -10..=10 { @@ -1089,7 +1085,7 @@ impl Option { /// ``` #[inline] #[track_caller] - #[unstable(feature = "option_expect_none", reason = "newly added", issue = "62633")] + #[stable(feature = "option_expect_none", since = "1.45.0")] pub fn expect_none(self, msg: &str) { if let Some(val) = self { expect_none_failed(msg, &val); @@ -1109,8 +1105,6 @@ impl Option { /// # Examples /// /// ``` - /// #![feature(option_unwrap_none)] - /// /// use std::collections::HashMap; /// let mut squares = HashMap::new(); /// for i in -10..=10 { @@ -1120,8 +1114,6 @@ impl Option { /// ``` /// /// ```{.should_panic} - /// #![feature(option_unwrap_none)] - /// /// use std::collections::HashMap; /// let mut sqrts = HashMap::new(); /// for i in -10..=10 { @@ -1132,7 +1124,7 @@ impl Option { /// ``` #[inline] #[track_caller] - #[unstable(feature = "option_unwrap_none", reason = "newly added", issue = "62633")] + #[stable(feature = "option_unwrap_none", since = "1.45.0")] pub fn unwrap_none(self) { if let Some(val) = self { expect_none_failed("called `Option::unwrap_none()` on a `Some` value", &val); diff --git a/src/libcore/tests/lib.rs b/src/libcore/tests/lib.rs index 37ebf4112808e..ee060d18ff2eb 100644 --- a/src/libcore/tests/lib.rs +++ b/src/libcore/tests/lib.rs @@ -42,7 +42,6 @@ #![feature(unwrap_infallible)] #![feature(leading_trailing_ones)] #![feature(const_forget)] -#![feature(option_unwrap_none)] #![feature(peekable_next_if)] extern crate test; diff --git a/src/librustc_middle/lib.rs b/src/librustc_middle/lib.rs index 7c433574d1843..9a5ea246fd943 100644 --- a/src/librustc_middle/lib.rs +++ b/src/librustc_middle/lib.rs @@ -39,7 +39,6 @@ #![feature(marker_trait_attr)] #![feature(extern_types)] #![feature(nll)] -#![feature(option_expect_none)] #![feature(or_patterns)] #![feature(range_is_empty)] #![feature(specialization)] // FIXME: min_specialization does not work diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index 928d5bf88f2fc..0fd4aeb9513a0 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -27,7 +27,6 @@ Rust MIR: a lowered representation of Rust. #![feature(range_is_empty)] #![feature(stmt_expr_attributes)] #![feature(trait_alias)] -#![feature(option_expect_none)] #![feature(or_patterns)] #![recursion_limit = "256"] diff --git a/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs b/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs index 35a2956ee26b8..f53d7d4197354 100644 --- a/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs +++ b/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs @@ -1,7 +1,6 @@ // run-pass // ignore-wasm32-bare compiled with panic=abort by default -#![feature(option_expect_none, option_unwrap_none)] #![allow(unconditional_panic)] //! Test that panic locations for `#[track_caller]` functions in std have the correct