std: Drop Total from Total{Eq,Ord}

This completes the last stage of the renaming of the comparison hierarchy of
traits. This change renames TotalEq to Eq and TotalOrd to Ord.

In the future the new Eq/Ord will be filled out with their appropriate methods,
but for now this change is purely a renaming change.

[breaking-change]
This commit is contained in:
Alex Crichton 2014-05-31 10:43:52 -07:00
parent c605c2b57b
commit bba701c59d
83 changed files with 436 additions and 431 deletions

View file

@ -30,7 +30,7 @@ static OCCURRENCES: [&'static str, ..5] = [
// Code implementation
#[deriving(PartialEq, PartialOrd, TotalOrd, TotalEq)]
#[deriving(PartialEq, PartialOrd, Ord, Eq)]
struct Code(u64);
impl Code {

View file

@ -16,7 +16,7 @@ extern crate rand;
#[deriving(PartialEq)]
struct Error;
#[deriving(TotalEq,PartialEq)]
#[deriving(Eq,PartialEq)]
enum Enum {
A {
x: Error //~ ERROR

View file

@ -16,7 +16,7 @@ extern crate rand;
#[deriving(PartialEq)]
struct Error;
#[deriving(TotalEq,PartialEq)]
#[deriving(Eq,PartialEq)]
enum Enum {
A(
Error //~ ERROR

View file

@ -16,7 +16,7 @@ extern crate rand;
#[deriving(PartialEq)]
struct Error;
#[deriving(TotalEq,PartialEq)]
#[deriving(Eq,PartialEq)]
struct Struct {
x: Error //~ ERROR
}

View file

@ -16,7 +16,7 @@ extern crate rand;
#[deriving(PartialEq)]
struct Error;
#[deriving(TotalEq,PartialEq)]
#[deriving(Eq,PartialEq)]
struct Struct(
Error //~ ERROR
);

View file

@ -13,10 +13,10 @@
#![feature(struct_variant)]
extern crate rand;
#[deriving(TotalEq,PartialOrd,PartialEq)]
#[deriving(Eq,PartialOrd,PartialEq)]
struct Error;
#[deriving(TotalOrd,TotalEq,PartialOrd,PartialEq)]
#[deriving(Ord,Eq,PartialOrd,PartialEq)]
enum Enum {
A {
x: Error //~ ERROR

View file

@ -13,10 +13,10 @@
#![feature(struct_variant)]
extern crate rand;
#[deriving(TotalEq,PartialOrd,PartialEq)]
#[deriving(Eq,PartialOrd,PartialEq)]
struct Error;
#[deriving(TotalOrd,TotalEq,PartialOrd,PartialEq)]
#[deriving(Ord,Eq,PartialOrd,PartialEq)]
enum Enum {
A(
Error //~ ERROR

View file

@ -13,10 +13,10 @@
#![feature(struct_variant)]
extern crate rand;
#[deriving(TotalEq,PartialOrd,PartialEq)]
#[deriving(Eq,PartialOrd,PartialEq)]
struct Error;
#[deriving(TotalOrd,TotalEq,PartialOrd,PartialEq)]
#[deriving(Ord,Eq,PartialOrd,PartialEq)]
struct Struct {
x: Error //~ ERROR
}

View file

@ -13,10 +13,10 @@
#![feature(struct_variant)]
extern crate rand;
#[deriving(TotalEq,PartialOrd,PartialEq)]
#[deriving(Eq,PartialOrd,PartialEq)]
struct Error;
#[deriving(TotalOrd,TotalEq,PartialOrd,PartialEq)]
#[deriving(Ord,Eq,PartialOrd,PartialEq)]
struct Struct(
Error //~ ERROR
);

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving(PartialEq, TotalEq, PartialOrd, TotalOrd)]
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
enum E<T> {
E0,
E1(T),
@ -22,7 +22,7 @@ pub fn main() {
let e21 = E2(1, 1);
let e22 = E2(1, 2);
// in order for both PartialOrd and TotalOrd
// in order for both PartialOrd and Ord
let es = [e0, e11, e12, e21, e22];
for (i, e1) in es.iter().enumerate() {
@ -46,7 +46,7 @@ pub fn main() {
assert_eq!(*e1 <= *e2, le);
assert_eq!(*e1 >= *e2, ge);
// TotalOrd
// Ord
assert_eq!(e1.cmp(e2), ord);
}
}

View file

@ -10,7 +10,7 @@
#![feature(struct_variant)]
#[deriving(PartialEq, TotalEq, PartialOrd, TotalOrd)]
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
enum ES<T> {
ES1 { x: T },
ES2 { x: T, y: T }
@ -20,7 +20,7 @@ enum ES<T> {
pub fn main() {
let (es11, es12, es21, es22) = (ES1 {x: 1}, ES1 {x: 2}, ES2 {x: 1, y: 1}, ES2 {x: 1, y: 2});
// in order for both PartialOrd and TotalOrd
// in order for both PartialOrd and Ord
let ess = [es11, es12, es21, es22];
for (i, es1) in ess.iter().enumerate() {
@ -42,7 +42,7 @@ pub fn main() {
assert_eq!(*es1 <= *es2, le);
assert_eq!(*es1 >= *es2, ge);
// TotalOrd
// Ord
assert_eq!(es1.cmp(es2), ord);
}
}

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving(PartialEq, TotalEq, PartialOrd, TotalOrd)]
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
struct S<T> {
x: T,
y: T
@ -18,7 +18,7 @@ pub fn main() {
let s1 = S {x: 1, y: 1};
let s2 = S {x: 1, y: 2};
// in order for both PartialOrd and TotalOrd
// in order for both PartialOrd and Ord
let ss = [s1, s2];
for (i, s1) in ss.iter().enumerate() {
@ -42,7 +42,7 @@ pub fn main() {
assert_eq!(*s1 <= *s2, le);
assert_eq!(*s1 >= *s2, ge);
// TotalOrd
// Ord
assert_eq!(s1.cmp(s2), ord);
}
}

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving(PartialEq, TotalEq, PartialOrd, TotalOrd)]
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
struct TS<T>(T,T);
@ -16,7 +16,7 @@ pub fn main() {
let ts1 = TS(1, 1);
let ts2 = TS(1, 2);
// in order for both PartialOrd and TotalOrd
// in order for both PartialOrd and Ord
let tss = [ts1, ts2];
for (i, ts1) in tss.iter().enumerate() {
@ -40,7 +40,7 @@ pub fn main() {
assert_eq!(*ts1 <= *ts2, le);
assert_eq!(*ts1 >= *ts2, ge);
// TotalOrd
// Ord
assert_eq!(ts1.cmp(ts2), ord);
}
}

View file

@ -21,13 +21,13 @@ impl PartialOrd for FailCmp {
fn lt(&self, _: &FailCmp) -> bool { fail!("lt") }
}
impl TotalEq for FailCmp {}
impl Eq for FailCmp {}
impl TotalOrd for FailCmp {
impl Ord for FailCmp {
fn cmp(&self, _: &FailCmp) -> Ordering { fail!("cmp") }
}
#[deriving(PartialEq,PartialOrd,TotalEq,TotalOrd)]
#[deriving(PartialEq,PartialOrd,Eq,Ord)]
struct ShortCircuit {
x: int,
y: FailCmp

View file

@ -15,21 +15,21 @@ mod submod {
// if any of these are implemented without global calls for any
// function calls, then being in a submodule will (correctly)
// cause errors about unrecognised module `std` (or `extra`)
#[deriving(PartialEq, PartialOrd, TotalEq, TotalOrd,
#[deriving(PartialEq, PartialOrd, Eq, Ord,
Hash,
Clone,
Show, Rand,
Encodable, Decodable)]
enum A { A1(uint), A2(int) }
#[deriving(PartialEq, PartialOrd, TotalEq, TotalOrd,
#[deriving(PartialEq, PartialOrd, Eq, Ord,
Hash,
Clone,
Show, Rand,
Encodable, Decodable)]
struct B { x: uint, y: int }
#[deriving(PartialEq, PartialOrd, TotalEq, TotalOrd,
#[deriving(PartialEq, PartialOrd, Eq, Ord,
Hash,
Clone,
Show, Rand,

View file

@ -12,7 +12,7 @@
use std::cmp::{Less,Equal,Greater};
#[deriving(TotalEq,TotalOrd)]
#[deriving(Eq,Ord)]
struct A<'a> {
x: &'a int
}

View file

@ -13,7 +13,7 @@ extern crate collections;
use collections::HashSet;
#[deriving(PartialEq, TotalEq, Hash)]
#[deriving(PartialEq, Eq, Hash)]
struct XYZ {
x: int,
y: int,

View file

@ -40,7 +40,7 @@ impl<'tcx> PartialEq for TypeStructure<'tcx> {
}
}
impl<'tcx> TotalEq for TypeStructure<'tcx> {}
impl<'tcx> Eq for TypeStructure<'tcx> {}
struct TypeContext<'tcx, 'ast> {
ty_arena: &'tcx Arena,
@ -86,7 +86,7 @@ impl<'tcx,'ast> TypeContext<'tcx, 'ast> {
}
}
#[deriving(PartialEq, TotalEq, Hash)]
#[deriving(PartialEq, Eq, Hash)]
struct NodeId {
id: uint
}

View file

@ -15,7 +15,7 @@ static MAX_LEN: uint = 20;
static mut drop_counts: [uint, .. MAX_LEN] = [0, .. MAX_LEN];
static mut clone_count: uint = 0;
#[deriving(Rand, PartialEq, PartialOrd, TotalEq, TotalOrd)]
#[deriving(Rand, PartialEq, PartialOrd, Eq, Ord)]
struct DropCounter { x: uint, clone_num: uint }
impl Clone for DropCounter {