Skip to content

Commit 4467990

Browse files
committed
Update num-macros to Rust master
1 parent b75dbbd commit 4467990

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

.gitignore

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
/Cargo.lock
2-
/num_macros/Cargo.lock
3-
/num_macros/target
4-
/target
1+
Cargo.lock
2+
target

num-macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "num-macros"
3-
version = "0.1.22"
3+
version = "0.1.23"
44
authors = ["The Rust Project Developers"]
55
license = "MIT/Apache-2.0"
66
homepage = "https://github.com/rust-lang/num"

num-macros/src/lib.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
extern crate syntax;
1414
extern crate rustc;
1515

16-
use syntax::ast::{MetaItem, Item, Expr};
16+
use syntax::ast::{MetaItem, Expr};
1717
use syntax::ast;
1818
use syntax::codemap::Span;
19-
use syntax::ext::base::ExtCtxt;
19+
use syntax::ext::base::{ExtCtxt, Annotatable};
2020
use syntax::ext::build::AstBuilder;
2121
use syntax::ext::deriving::generic::*;
2222
use syntax::ext::deriving::generic::ty::*;
2323
use syntax::parse::token::InternedString;
2424
use syntax::ptr::P;
25-
use syntax::ext::base::Decorator;
25+
use syntax::ext::base::MultiDecorator;
2626
use syntax::parse::token;
2727

2828
use rustc::plugin::Registry;
@@ -64,8 +64,8 @@ macro_rules! path_std {
6464
pub fn expand_deriving_from_primitive(cx: &mut ExtCtxt,
6565
span: Span,
6666
mitem: &MetaItem,
67-
item: &Item,
68-
push: &mut FnMut(P<Item>))
67+
item: Annotatable,
68+
push: &mut FnMut(Annotatable))
6969
{
7070
let inline = cx.meta_word(span, InternedString::new("inline"));
7171
let attrs = vec!(cx.attribute(span, inline));
@@ -110,7 +110,7 @@ pub fn expand_deriving_from_primitive(cx: &mut ExtCtxt,
110110
associated_types: Vec::new(),
111111
};
112112

113-
trait_def.expand(cx, mitem, item, push)
113+
trait_def.expand(cx, mitem, &item, push)
114114
}
115115

116116
fn cs_from(name: &str, cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> P<Expr> {
@@ -196,5 +196,5 @@ fn cs_from(name: &str, cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure
196196
pub fn plugin_registrar(reg: &mut Registry) {
197197
reg.register_syntax_extension(
198198
token::intern("derive_NumFromPrimitive"),
199-
Decorator(Box::new(expand_deriving_from_primitive)));
199+
MultiDecorator(Box::new(expand_deriving_from_primitive)));
200200
}

0 commit comments

Comments
 (0)