diff options
Diffstat (limited to 'library/core/src/bool.rs')
| -rw-r--r-- | library/core/src/bool.rs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/library/core/src/bool.rs b/library/core/src/bool.rs index db1c505ba38..374759e3816 100644 --- a/library/core/src/bool.rs +++ b/library/core/src/bool.rs @@ -1,7 +1,5 @@ //! impl bool {} -use crate::marker::Destruct; - impl bool { /// Returns `Some(t)` if the `bool` is [`true`](../std/keyword.true.html), /// or `None` otherwise. @@ -31,11 +29,8 @@ impl bool { /// assert_eq!(a, 2); /// ``` #[stable(feature = "bool_to_option", since = "1.62.0")] - #[rustc_const_unstable(feature = "const_bool_to_option", issue = "91917")] #[inline] - pub const fn then_some<T>(self, t: T) -> Option<T> - where - T: ~const Destruct, + pub fn then_some<T>(self, t: T) -> Option<T> { if self { Some(t) } else { None } } @@ -61,12 +56,8 @@ impl bool { /// assert_eq!(a, 1); /// ``` #[stable(feature = "lazy_bool_to_option", since = "1.50.0")] - #[rustc_const_unstable(feature = "const_bool_to_option", issue = "91917")] #[inline] - pub const fn then<T, F>(self, f: F) -> Option<T> - where - F: ~const FnOnce() -> T, - F: ~const Destruct, + pub fn then<T, F: FnOnce() -> T>(self, f: F) -> Option<T> { if self { Some(f()) } else { None } } |
