]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/ext/deriving/cmp/totalord.rs
auto merge of #13704 : edwardw/rust/doc-hidden, r=alexcrichton
[rust.git] / src / libsyntax / ext / deriving / cmp / totalord.rs
index 69c413890e902fa3cf449ab3132d7d6d024fffeb..3ca4f9e28626380da776cee61b04e8c3a0d70cf3 100644 (file)
@@ -14,6 +14,7 @@
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
 use ext::deriving::generic::*;
+use parse::token::InternedString;
 
 use std::cmp::{Ordering, Equal, Less, Greater};
 
@@ -22,6 +23,8 @@ pub fn expand_deriving_totalord(cx: &mut ExtCtxt,
                                 mitem: @MetaItem,
                                 item: @Item,
                                 push: |@Item|) {
+    let inline = cx.meta_word(span, InternedString::new("inline"));
+    let attrs = vec!(cx.attribute(span, inline));
     let trait_def = TraitDef {
         span: span,
         attributes: Vec::new(),
@@ -35,7 +38,7 @@ pub fn expand_deriving_totalord(cx: &mut ExtCtxt,
                 explicit_self: borrowed_explicit_self(),
                 args: vec!(borrowed_self()),
                 ret_ty: Literal(Path::new(vec!("std", "cmp", "Ordering"))),
-                inline: true,
+                attributes: attrs,
                 const_nonmatching: false,
                 combine_substructure: combine_substructure(|a, b, c| {
                     cs_cmp(a, b, c)