Skip to content

Commit 2f5722c

Browse files
committed
Make Option const PartialEq
1 parent 014bd82 commit 2f5722c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/core/src/option.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2243,7 +2243,8 @@ impl<'a, T> From<&'a mut Option<T>> for Option<&'a mut T> {
22432243
#[stable(feature = "rust1", since = "1.0.0")]
22442244
impl<T> crate::marker::StructuralPartialEq for Option<T> {}
22452245
#[stable(feature = "rust1", since = "1.0.0")]
2246-
impl<T: PartialEq> PartialEq for Option<T> {
2246+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
2247+
impl<T: ~const PartialEq> const PartialEq for Option<T> {
22472248
#[inline]
22482249
fn eq(&self, other: &Self) -> bool {
22492250
// Spelling out the cases explicitly optimizes better than

0 commit comments

Comments
 (0)