From 7906c5572a8c4c5c0f6aa6e69bb63d64de50d697 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Sun, 31 Mar 2013 01:58:05 +1100 Subject: libsyntax: derive Clone, Eq, TotalEq, Ord, TotalOrd with the new generic deriving code. Closes #4269, #5588 and #5589. --- src/libsyntax/ext/deriving/mod.rs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/libsyntax/ext/deriving/mod.rs') diff --git a/src/libsyntax/ext/deriving/mod.rs b/src/libsyntax/ext/deriving/mod.rs index 1241d4fa711..78faf5556b2 100644 --- a/src/libsyntax/ext/deriving/mod.rs +++ b/src/libsyntax/ext/deriving/mod.rs @@ -30,12 +30,21 @@ use opt_vec; use core::uint; -pub mod eq; pub mod clone; pub mod iter_bytes; pub mod encodable; pub mod decodable; +#[path="cmp/eq.rs"] +pub mod eq; +#[path="cmp/totaleq.rs"] +pub mod totaleq; +#[path="cmp/ord.rs"] +pub mod ord; +#[path="cmp/totalord.rs"] +pub mod totalord; + + pub mod generic; pub type ExpandDerivingStructDefFn<'self> = &'self fn(@ext_ctxt, @@ -74,8 +83,6 @@ pub fn expand_meta_deriving(cx: @ext_ctxt, meta_list(tname, _) | meta_word(tname) => { match *tname { - ~"Eq" => eq::expand_deriving_eq(cx, titem.span, - titem, in_items), ~"Clone" => clone::expand_deriving_clone(cx, titem.span, titem, in_items), ~"IterBytes" => iter_bytes::expand_deriving_iter_bytes(cx, @@ -84,6 +91,14 @@ pub fn expand_meta_deriving(cx: @ext_ctxt, titem.span, titem, in_items), ~"Decodable" => decodable::expand_deriving_decodable(cx, titem.span, titem, in_items), + ~"Eq" => eq::expand_deriving_eq(cx, titem.span, + titem, in_items), + ~"TotalEq" => totaleq::expand_deriving_totaleq(cx, titem.span, + titem, in_items), + ~"Ord" => ord::expand_deriving_ord(cx, titem.span, + titem, in_items), + ~"TotalOrd" => totalord::expand_deriving_totalord(cx, titem.span, + titem, in_items), tname => { cx.span_err(titem.span, fmt!("unknown \ `deriving` trait: `%s`", tname)); -- cgit 1.4.1-3-g733a5