X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibsyntax%2Fext%2Fderiving%2Fcmp%2Ford.rs;fp=src%2Flibsyntax%2Fext%2Fderiving%2Fcmp%2Ford.rs;h=dd2f90cfa5fae9ac21880ad8a78513c6567d063d;hb=4e1a09844e49a91d0f9dea19561f15d34992d0e8;hp=afe2d3dae6a71e63a0b4c3cee718e2bec920dea9;hpb=0e750adefcb1985fc0fa60a240d9b8abbbc457c5;p=rust.git diff --git a/src/libsyntax/ext/deriving/cmp/ord.rs b/src/libsyntax/ext/deriving/cmp/ord.rs index afe2d3dae6a..dd2f90cfa5f 100644 --- a/src/libsyntax/ext/deriving/cmp/ord.rs +++ b/src/libsyntax/ext/deriving/cmp/ord.rs @@ -14,6 +14,7 @@ use ext::base::ExtCtxt; use ext::build::AstBuilder; use ext::deriving::generic::*; +use parse::token::InternedString; pub fn expand_deriving_ord(cx: &mut ExtCtxt, span: Span, @@ -21,20 +22,22 @@ pub fn expand_deriving_ord(cx: &mut ExtCtxt, item: @Item, push: |@Item|) { macro_rules! md ( - ($name:expr, $op:expr, $equal:expr) => { + ($name:expr, $op:expr, $equal:expr) => { { + let inline = cx.meta_word(span, InternedString::new("inline")); + let attrs = vec!(cx.attribute(span, inline)); MethodDef { name: $name, generics: LifetimeBounds::empty(), explicit_self: borrowed_explicit_self(), args: vec!(borrowed_self()), ret_ty: Literal(Path::new(vec!("bool"))), - inline: true, + attributes: attrs, const_nonmatching: false, combine_substructure: combine_substructure(|cx, span, substr| { cs_op($op, $equal, cx, span, substr) }) } - } + } } ); let trait_def = TraitDef {