Skip to content

Commit b25d3fc

Browse files
committed
---
yaml --- r: 205116 b: refs/heads/tmp c: 77d5921 h: refs/heads/master v: v3
1 parent 7a37c51 commit b25d3fc

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: f0213d8ffb128a16f94af7ee985dc61484596163
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: 57690399a2ab6dd579ea1f97e9866b213f8b14d4
35+
refs/heads/tmp: 77d59217a38e2982fdcf6bff800f1c9acc0d9aaf
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: f0ac7e04e647381e2bb87de1f3d0b108acb24d06
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,29 @@ impl Annotatable {
150150
}
151151
}
152152

153+
// A more flexible ItemDecorator.
154+
pub trait MultiItemDecorator {
155+
fn expand(&self,
156+
ecx: &mut ExtCtxt,
157+
sp: Span,
158+
meta_item: &ast::MetaItem,
159+
item: &Annotatable,
160+
push: Box<FnMut(P<Annotatable>)>);
161+
}
162+
163+
impl<F> MultiItemDecorator for F
164+
where F : Fn(&mut ExtCtxt, Span, &ast::MetaItem, &Annotatable, Box<FnMut(P<Annotatable>)>)
165+
{
166+
fn expand(&self,
167+
ecx: &mut ExtCtxt,
168+
sp: Span,
169+
meta_item: &ast::MetaItem,
170+
item: &Annotatable,
171+
push: Box<FnMut(P<Annotatable>)>) {
172+
(*self)(ecx, sp, meta_item, item, push)
173+
}
174+
}
175+
153176
// A more flexible ItemModifier (ItemModifier should go away, eventually, FIXME).
154177
// meta_item is the annotation, item is the item being modified, parent_item
155178
// is the impl or trait item is declared in if item is part of such a thing.

0 commit comments

Comments
 (0)