Skip to content

Commit 5d9c537

Browse files
committed
Make NonZero const PartialEq
1 parent b363d84 commit 5d9c537

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/core/src/num/nonzero.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,10 @@ impl<T> UseCloned for NonZero<T> where T: ZeroablePrimitive {}
200200
impl<T> Copy for NonZero<T> where T: ZeroablePrimitive {}
201201

202202
#[stable(feature = "nonzero", since = "1.28.0")]
203-
impl<T> PartialEq for NonZero<T>
203+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
204+
impl<T> const PartialEq for NonZero<T>
204205
where
205-
T: ZeroablePrimitive + PartialEq,
206+
T: ZeroablePrimitive + ~const PartialEq,
206207
{
207208
#[inline]
208209
fn eq(&self, other: &Self) -> bool {

0 commit comments

Comments
 (0)