diff options
| author | David Tolnay <dtolnay@gmail.com> | 2021-11-21 19:06:35 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2021-11-21 19:11:00 -0800 |
| commit | 9e834785787961646fd3951757b48d87f1afe6ef (patch) | |
| tree | 1c96863a3bd8d65b484db2e1636e179f146bd24b | |
| parent | a4bff741d0bd128dc92a7e36c96af91461bd3611 (diff) | |
| download | rust-9e834785787961646fd3951757b48d87f1afe6ef.tar.gz rust-9e834785787961646fd3951757b48d87f1afe6ef.zip | |
impl Not for !
| -rw-r--r-- | library/core/src/ops/bit.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/library/core/src/ops/bit.rs b/library/core/src/ops/bit.rs index 255f6cb7933..d9ce84541cf 100644 --- a/library/core/src/ops/bit.rs +++ b/library/core/src/ops/bit.rs @@ -68,6 +68,17 @@ macro_rules! not_impl { not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } +#[stable(feature = "not_never", since = "1.58.0")] +#[rustc_const_unstable(feature = "const_ops", issue = "90080")] +impl const Not for ! { + type Output = !; + + #[inline] + fn not(self) -> ! { + match self {} + } +} + /// The bitwise AND operator `&`. /// /// Note that `Rhs` is `Self` by default, but this is not mandatory. |
