diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-07-11 10:34:29 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-07-17 15:42:54 +0000 |
| commit | 9d29583355018f00d65b9d5e08758e3f9bcba97c (patch) | |
| tree | f399cad3cbb97cfc10821c87e0f606c0d1b012cb | |
| parent | 2f5722cf1bdd4ffcdf46e85ffbd97455aaeec7de (diff) | |
| download | rust-9d29583355018f00d65b9d5e08758e3f9bcba97c.tar.gz rust-9d29583355018f00d65b9d5e08758e3f9bcba97c.zip | |
Make `NonZero` `const PartialEq`
| -rw-r--r-- | library/core/src/num/nonzero.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index 11d50e0f89f..b8900c4113a 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -200,9 +200,10 @@ impl<T> UseCloned for NonZero<T> where T: ZeroablePrimitive {} impl<T> Copy for NonZero<T> where T: ZeroablePrimitive {} #[stable(feature = "nonzero", since = "1.28.0")] -impl<T> PartialEq for NonZero<T> +#[rustc_const_unstable(feature = "const_cmp", issue = "143800")] +impl<T> const PartialEq for NonZero<T> where - T: ZeroablePrimitive + PartialEq, + T: ZeroablePrimitive + ~const PartialEq, { #[inline] fn eq(&self, other: &Self) -> bool { |
