diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-03-31 01:58:05 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-04-12 17:10:27 +1000 |
| commit | 7906c5572a8c4c5c0f6aa6e69bb63d64de50d697 (patch) | |
| tree | c60b9e98a0bd0bbc5198ce74ac7c0d9b6b3217c5 /src/libsyntax/ext/deriving/mod.rs | |
| parent | 85b82c763bfbfd5de59f4c6b026dca58f3ba4687 (diff) | |
| download | rust-7906c5572a8c4c5c0f6aa6e69bb63d64de50d697.tar.gz rust-7906c5572a8c4c5c0f6aa6e69bb63d64de50d697.zip | |
libsyntax: derive Clone, Eq, TotalEq, Ord, TotalOrd with the new generic deriving code.
Closes #4269, #5588 and #5589.
Diffstat (limited to 'src/libsyntax/ext/deriving/mod.rs')
| -rw-r--r-- | src/libsyntax/ext/deriving/mod.rs | 21 |
1 files changed, 18 insertions, 3 deletions
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)); |
