about summary refs log tree commit diff
path: root/library/core
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2025-02-17 16:27:42 -0800
committerScott McMurray <scottmcm@users.noreply.github.com>2025-02-17 16:36:14 -0800
commit3a3aedee10e6d34ca6889bd4b2b4f535f6ea0cbf (patch)
tree5e94fdffd277a6c06f25efd2e4ad4ac9428ddc79 /library/core
parentce36a966c79e109dabeef7a47fe68e5294c6d71e (diff)
downloadrust-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.rs8
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)
     }
 }