]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/deriving-cmp-shortcircuit.rs
cleanup: s/impl Copy/#[derive(Copy)]/g
[rust.git] / src / test / run-pass / deriving-cmp-shortcircuit.rs
index fd59b804da3769c93bb027f19b265d14cbb9ea95..bc55b9132c836314b665fa11edf39971241c1ac6 100644 (file)
@@ -12,6 +12,8 @@
 // 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") }
@@ -27,7 +29,7 @@ impl Ord for FailCmp {
     fn cmp(&self, _: &FailCmp) -> Ordering { panic!("cmp") }
 }
 
-#[deriving(PartialEq,PartialOrd,Eq,Ord)]
+#[derive(PartialEq,PartialOrd,Eq,Ord)]
 struct ShortCircuit {
     x: int,
     y: FailCmp
@@ -39,5 +41,5 @@ pub fn main() {
 
     assert!(a != b);
     assert!(a < b);
-    assert_eq!(a.cmp(&b), ::std::cmp::Less);
+    assert_eq!(a.cmp(&b), ::std::cmp::Ordering::Less);
 }