about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/core/tests/cmp.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/library/core/tests/cmp.rs b/library/core/tests/cmp.rs
index 2b234de6795..8d0e59d5a49 100644
--- a/library/core/tests/cmp.rs
+++ b/library/core/tests/cmp.rs
@@ -134,6 +134,19 @@ fn ordering_const() {
 }
 
 #[test]
+fn ordering_structural_eq() {
+    // test that consts of type `Ordering` are usable in patterns
+
+    const ORDERING: Ordering = Greater;
+
+    const REVERSE: Ordering = ORDERING.reverse();
+    match Ordering::Less {
+        REVERSE => {}
+        _ => unreachable!(),
+    };
+}
+
+#[test]
 fn cmp_default() {
     // Test default methods in PartialOrd and PartialEq