]> git.lizzy.rs Git - rust.git/commitdiff
rollup merge of #19812: frewsxcv/expansion-include-enum
authorBrian Anderson <banderson@mozilla.com>
Sun, 14 Dec 2014 02:24:42 +0000 (18:24 -0800)
committerBrian Anderson <banderson@mozilla.com>
Mon, 15 Dec 2014 14:45:36 +0000 (06:45 -0800)
In preparation for [removing the `std::cmp::Ordering` reexport](https://github.com/rust-lang/rust/issues/19253), this needs to be done to prevent errors like:

```
note: in expansion of #[deriving]
note: expansion site
error: unresolved name `std::cmp::Equal`
#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Show)]
                                             ^~~
```

1  2 
src/libsyntax/ext/deriving/cmp/totalord.rs

index a2bf46f41fc961a146a05f0d8a14a5b76d6f7ae3,bb9670c8e81f499403d699ca3aa5641ced37d7b0..65a4c569b44b64b3cc936164303c9d81d21172b6
@@@ -18,13 -18,11 +18,13 @@@ use ext::deriving::generic::ty::*
  use parse::token::InternedString;
  use ptr::P;
  
 -pub fn expand_deriving_totalord(cx: &mut ExtCtxt,
 -                                span: Span,
 -                                mitem: &MetaItem,
 -                                item: &Item,
 -                                push: |P<Item>|) {
 +pub fn expand_deriving_totalord<F>(cx: &mut ExtCtxt,
 +                                   span: Span,
 +                                   mitem: &MetaItem,
 +                                   item: &Item,
 +                                   push: F) where
 +    F: FnOnce(P<Item>),
 +{
      let inline = cx.meta_word(span, InternedString::new("inline"));
      let attrs = vec!(cx.attribute(span, inline));
      let trait_def = TraitDef {
@@@ -66,6 -64,7 +66,7 @@@ pub fn cs_cmp(cx: &mut ExtCtxt, span: S
      let equals_path = cx.path_global(span,
                                       vec!(cx.ident_of("std"),
                                            cx.ident_of("cmp"),
+                                           cx.ident_of("Ordering"),
                                            cx.ident_of("Equal")));
  
      let cmp_path = vec![