We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba611d5 commit b13b495Copy full SHA for b13b495
library/core/tests/cmp.rs
@@ -133,6 +133,19 @@ fn ordering_const() {
133
assert_eq!(THEN, Greater);
134
}
135
136
+#[test]
137
+fn ordering_structural_eq() {
138
+ // test that consts of type `Ordering` are usable in patterns
139
+
140
+ const ORDERING: Ordering = Greater;
141
142
+ const REVERSE: Ordering = ORDERING.reverse();
143
+ match Ordering::Less {
144
+ REVERSE => {}
145
+ _ => unreachable!(),
146
+ };
147
+}
148
149
#[test]
150
fn cmp_default() {
151
// Test default methods in PartialOrd and PartialEq
0 commit comments