diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-02-17 16:27:42 -0800 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-02-17 16:36:14 -0800 |
| commit | 3a3aedee10e6d34ca6889bd4b2b4f535f6ea0cbf (patch) | |
| tree | 5e94fdffd277a6c06f25efd2e4ad4ac9428ddc79 /library/core | |
| parent | ce36a966c79e109dabeef7a47fe68e5294c6d71e (diff) | |
| download | rust-3a3aedee10e6d34ca6889bd4b2b4f535f6ea0cbf.tar.gz rust-3a3aedee10e6d34ca6889bd4b2b4f535f6ea0cbf.zip | |
Update some comparison tests now that they pass in LLVM20
Diffstat (limited to 'library/core')
| -rw-r--r-- | library/core/src/cmp.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index 594236cf1d9..c8ced78c4d7 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -1369,7 +1369,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_diagnostic_item = "cmp_partialord_lt"] fn lt(&self, other: &Rhs) -> bool { - matches!(self.partial_cmp(other), Some(Less)) + self.partial_cmp(other).is_some_and(Ordering::is_lt) } /// Tests less than or equal to (for `self` and `other`) and is used by the @@ -1387,7 +1387,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_diagnostic_item = "cmp_partialord_le"] fn le(&self, other: &Rhs) -> bool { - matches!(self.partial_cmp(other), Some(Less | Equal)) + self.partial_cmp(other).is_some_and(Ordering::is_le) } /// Tests greater than (for `self` and `other`) and is used by the `>` @@ -1405,7 +1405,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_diagnostic_item = "cmp_partialord_gt"] fn gt(&self, other: &Rhs) -> bool { - matches!(self.partial_cmp(other), Some(Greater)) + self.partial_cmp(other).is_some_and(Ordering::is_gt) } /// Tests greater than or equal to (for `self` and `other`) and is used by @@ -1423,7 +1423,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_diagnostic_item = "cmp_partialord_ge"] fn ge(&self, other: &Rhs) -> bool { - matches!(self.partial_cmp(other), Some(Greater | Equal)) + self.partial_cmp(other).is_some_and(Ordering::is_ge) } } |
