diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-05-29 20:57:18 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-05-30 16:03:25 -0700 |
| commit | bb96ee6123082908dba86cb22344f0c23915bf06 (patch) | |
| tree | 4e5cb402fc334bc776f7e6b0c3b3d7e4bb2a4291 /src/libsyntax | |
| parent | 748bc3ca49de8ab0b890726120c40567094e43fc (diff) | |
| download | rust-bb96ee6123082908dba86cb22344f0c23915bf06.tar.gz rust-bb96ee6123082908dba86cb22344f0c23915bf06.zip | |
syntax: Prepare for Total{Eq,Ord} => {Eq,Ord}
This commit adds the groundwork for the renaming of the Total{Eq,Ord} traits.
After this commit hits a snapshot, the traits can be renamed.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/deriving/cmp/totaleq.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/cmp/totalord.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/mod.rs | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/libsyntax/ext/deriving/cmp/totaleq.rs b/src/libsyntax/ext/deriving/cmp/totaleq.rs index b76caccffec..a8124493acb 100644 --- a/src/libsyntax/ext/deriving/cmp/totaleq.rs +++ b/src/libsyntax/ext/deriving/cmp/totaleq.rs @@ -28,7 +28,7 @@ pub fn expand_deriving_totaleq(cx: &mut ExtCtxt, let block = cx.block(span, stmts, None); cx.expr_block(block) }, - |cx, sp, _, _| cx.span_bug(sp, "non matching enums in deriving(TotalEq)?"), + |cx, sp, _, _| cx.span_bug(sp, "non matching enums in deriving(Eq)?"), cx, span, substr) @@ -42,7 +42,7 @@ pub fn expand_deriving_totaleq(cx: &mut ExtCtxt, let trait_def = TraitDef { span: span, attributes: Vec::new(), - path: Path::new(vec!("std", "cmp", "TotalEq")), + path: Path::new(vec!("std", "cmp", "Eq")), additional_bounds: Vec::new(), generics: LifetimeBounds::empty(), methods: vec!( diff --git a/src/libsyntax/ext/deriving/cmp/totalord.rs b/src/libsyntax/ext/deriving/cmp/totalord.rs index 3ca4f9e2862..c4611a552f5 100644 --- a/src/libsyntax/ext/deriving/cmp/totalord.rs +++ b/src/libsyntax/ext/deriving/cmp/totalord.rs @@ -28,7 +28,7 @@ pub fn expand_deriving_totalord(cx: &mut ExtCtxt, let trait_def = TraitDef { span: span, attributes: Vec::new(), - path: Path::new(vec!("std", "cmp", "TotalOrd")), + path: Path::new(vec!("std", "cmp", "Ord")), additional_bounds: Vec::new(), generics: LifetimeBounds::empty(), methods: vec!( @@ -117,7 +117,7 @@ pub fn cs_cmp(cx: &mut ExtCtxt, span: Span, let order = ordering_const(cx, span, self_var.cmp(&other_var)); cx.expr_path(order) } - _ => cx.span_bug(span, "not exactly 2 arguments in `deriving(TotalOrd)`") + _ => cx.span_bug(span, "not exactly 2 arguments in `deriving(Ord)`") } }, cx, span, substr) diff --git a/src/libsyntax/ext/deriving/mod.rs b/src/libsyntax/ext/deriving/mod.rs index 3735248e9e2..1d8081e2ae3 100644 --- a/src/libsyntax/ext/deriving/mod.rs +++ b/src/libsyntax/ext/deriving/mod.rs @@ -77,10 +77,11 @@ pub fn expand_meta_deriving(cx: &mut ExtCtxt, "Encodable" => expand!(encodable::expand_deriving_encodable), "Decodable" => expand!(decodable::expand_deriving_decodable), + // NOTE: after a stage0 snap this needs treatment "PartialEq" => expand!(eq::expand_deriving_eq), - "TotalEq" => expand!(totaleq::expand_deriving_totaleq), + "Eq" | "TotalEq" => expand!(totaleq::expand_deriving_totaleq), "PartialOrd" => expand!(ord::expand_deriving_ord), - "TotalOrd" => expand!(totalord::expand_deriving_totalord), + "Ord" | "TotalOrd" => expand!(totalord::expand_deriving_totalord), "Rand" => expand!(rand::expand_deriving_rand), |
