// where possible, by having a type that panics when compared as the
// second element, so this passes iff the instances shortcircuit.
+use std::cmp::Ordering;
+
pub struct FailCmp;
impl PartialEq for FailCmp {
fn eq(&self, _: &FailCmp) -> bool { panic!("eq") }
fn cmp(&self, _: &FailCmp) -> Ordering { panic!("cmp") }
}
-#[deriving(PartialEq,PartialOrd,Eq,Ord)]
+#[derive(PartialEq,PartialOrd,Eq,Ord)]
struct ShortCircuit {
x: int,
y: FailCmp
assert!(a != b);
assert!(a < b);
- assert_eq!(a.cmp(&b), ::std::cmp::Less);
+ assert_eq!(a.cmp(&b), ::std::cmp::Ordering::Less);
}