summaryrefslogtreecommitdiffstats
path: root/library/core/src/bool.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/src/bool.rs')
-rw-r--r--library/core/src/bool.rs15
1 files changed, 2 insertions, 13 deletions
diff --git a/library/core/src/bool.rs b/library/core/src/bool.rs
index db1c505ba..03cdff9b1 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,12 +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,13 +55,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 }
}
}