Skip to content

Commit 704fc2f

Browse files
committed
impl Not for !
1 parent cd27c2f commit 704fc2f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

core/src/ops/bit.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ macro_rules! not_impl {
6868

6969
not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
7070

71+
#[stable(feature = "not_never", since = "1.58.0")]
72+
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
73+
impl const Not for ! {
74+
type Output = !;
75+
76+
#[inline]
77+
fn not(self) -> ! {
78+
match self {}
79+
}
80+
}
81+
7182
/// The bitwise AND operator `&`.
7283
///
7384
/// Note that `Rhs` is `Self` by default, but this is not mandatory.

0 commit comments

Comments
 (0)