Skip to content

Commit 72ccb95

Browse files
committed
---
yaml --- r: 210715 b: refs/heads/try c: 0a4f9a2 h: refs/heads/master i: 210713: 6fce171 210711: f4ce7ee v: v3
1 parent bda46ab commit 72ccb95

File tree

5 files changed

+14
-37
lines changed

5 files changed

+14
-37
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: 0a62a05c6736dce542529cb1eb67fc54c0b70db4
5+
refs/heads/try: 0a4f9a26962d85d57a0b603ad324bd86fdd474cf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/librustc/plugin/registry.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,8 @@ use lint::{LintPassObject, LintId, Lint};
1414
use session::Session;
1515

1616
use syntax::ext::base::{SyntaxExtension, NamedSyntaxExtension, NormalTT};
17-
<<<<<<< HEAD
18-
use syntax::ext::base::{IdentTT, Decorator, Modifier, MultiModifier, MacroRulesTT};
19-
use syntax::ext::base::MacroExpanderFn;
20-
=======
21-
use syntax::ext::base::{IdentTT, Decorator, MultiDecorator, Modifier, MultiModifier, MacroRulesTT};
22-
use syntax::ext::base::{MacroExpanderFn};
23-
>>>>>>> 143f2db3174103e459218958f567985b1f47944b
17+
use syntax::ext::base::{IdentTT, Decorator, Modifier, MultiModifier, MultiDecorator};
18+
use syntax::ext::base::{MacroExpanderFn, MacroRulesTT};
2419
use syntax::codemap::Span;
2520
use syntax::parse::token;
2621
use syntax::ptr::P;

branches/try/src/libsyntax/ext/base.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,18 @@ pub trait MultiItemDecorator {
145145
sp: Span,
146146
meta_item: &ast::MetaItem,
147147
item: &Annotatable,
148-
push: Box<FnMut(Annotatable)>);
148+
push: &mut FnMut(Annotatable));
149149
}
150150

151151
impl<F> MultiItemDecorator for F
152-
where F : Fn(&mut ExtCtxt, Span, &ast::MetaItem, &Annotatable, Box<FnMut(Annotatable)>)
152+
where F : Fn(&mut ExtCtxt, Span, &ast::MetaItem, &Annotatable, &mut FnMut(Annotatable))
153153
{
154154
fn expand(&self,
155155
ecx: &mut ExtCtxt,
156156
sp: Span,
157157
meta_item: &ast::MetaItem,
158158
item: &Annotatable,
159-
push: Box<FnMut(Annotatable)>) {
159+
push: &mut FnMut(Annotatable)) {
160160
(*self)(ecx, sp, meta_item, item, push)
161161
}
162162
}
@@ -515,13 +515,6 @@ fn initial_syntax_expander_table<'feat>(ecfg: &expand::ExpansionConfig<'feat>)
515515
syntax_expanders.insert(intern("log_syntax"),
516516
builtin_normal_expander(
517517
ext::log_syntax::expand_syntax_ext));
518-
<<<<<<< HEAD
519-
=======
520-
syntax_expanders.insert(intern("derive"),
521-
MultiDecorator(box ext::deriving::expand_meta_derive));
522-
syntax_expanders.insert(intern("deriving"),
523-
MultiDecorator(box ext::deriving::expand_deprecated_deriving));
524-
>>>>>>> 143f2db3174103e459218958f567985b1f47944b
525518

526519
ext::deriving::register_all(&mut syntax_expanders);
527520

@@ -586,11 +579,6 @@ fn initial_syntax_expander_table<'feat>(ecfg: &expand::ExpansionConfig<'feat>)
586579
syntax_expanders.insert(intern("cfg"),
587580
builtin_normal_expander(
588581
ext::cfg::expand_cfg));
589-
<<<<<<< HEAD
590-
=======
591-
syntax_expanders.insert(intern("cfg_attr"),
592-
MultiModifier(box ext::cfg_attr::expand));
593-
>>>>>>> 143f2db3174103e459218958f567985b1f47944b
594582
syntax_expanders.insert(intern("trace_macros"),
595583
builtin_normal_expander(
596584
ext::trace_macros::expand_trace_macros));

branches/try/src/libsyntax/ext/deriving/mod.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,8 @@ pub mod generic;
8080
fn expand_derive(cx: &mut ExtCtxt,
8181
span: Span,
8282
mitem: &MetaItem,
83-
annotatable: &Annotatable)
84-
-> P<Annotatable> {
85-
// Derive can only be applied to items
86-
let item = match annotatable {
87-
&Annotatable::Item(ref it) => it.clone(),
88-
_ => {
89-
cx.span_err(span, "`derive` can only be applied to items");
90-
return;
91-
}
92-
};
93-
83+
item: P<Item>)
84+
-> P<Item> {
9485
item.map(|mut item| {
9586
if mitem.value_str().is_some() {
9687
cx.span_err(mitem.span, "unexpected value in `derive`");
@@ -123,7 +114,7 @@ fn expand_derive(cx: &mut ExtCtxt,
123114
intern_and_get_ident(&format!("derive_{}", tname)))));
124115
}
125116

126-
Annotatable::Item(item)
117+
item
127118
})
128119
}
129120

branches/try/src/libsyntax/ext/expand.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,9 +1134,12 @@ fn expand_annotatable(a: Annotatable,
11341134
fld.cx.bt_push(ExpnInfo {
11351135
call_site: attr.span,
11361136
callee: NameAndSpan {
1137-
name: mname.get().to_string(),
1137+
name: mname.to_string(),
11381138
format: MacroAttribute,
1139-
span: None
1139+
span: Some(attr.span),
1140+
// attributes can do whatever they like,
1141+
// for now.
1142+
allow_internal_unstable: true,
11401143
}
11411144
});
11421145

0 commit comments

Comments
 (0)