@@ -62,15 +62,16 @@ fn expand_identity(cx: &mut ExtCtxt, _span: Span, tts: &[TokenTree])
62
62
fn expand_into_foo_multi ( cx : & mut ExtCtxt ,
63
63
sp : Span ,
64
64
attr : & MetaItem ,
65
- it : Annotatable ) -> Annotatable {
65
+ it : Annotatable ) -> Vec < Annotatable > {
66
66
match it {
67
- Annotatable :: Item ( it) => {
67
+ Annotatable :: Item ( it) => vec ! [
68
68
Annotatable :: Item ( P ( Item {
69
69
attrs: it. attrs. clone( ) ,
70
70
..( * quote_item!( cx, enum Foo2 { Bar2 , Baz2 } ) . unwrap( ) ) . clone( )
71
- } ) )
72
- }
73
- Annotatable :: ImplItem ( it) => {
71
+ } ) ) ,
72
+ Annotatable :: Item ( quote_item!( cx, enum Foo3 { Bar } ) . unwrap( ) ) ,
73
+ ] ,
74
+ Annotatable :: ImplItem ( it) => vec ! [
74
75
quote_item!( cx, impl X { fn foo( & self ) -> i32 { 42 } } ) . unwrap( ) . and_then( |i| {
75
76
match i. node {
76
77
ItemKind :: Impl ( _, _, _, _, _, mut items) => {
@@ -79,8 +80,8 @@ fn expand_into_foo_multi(cx: &mut ExtCtxt,
79
80
_ => unreachable!( "impl parsed to something other than impl" )
80
81
}
81
82
} )
82
- }
83
- Annotatable :: TraitItem ( it) => {
83
+ ] ,
84
+ Annotatable :: TraitItem ( it) => vec ! [
84
85
quote_item!( cx, trait X { fn foo( & self ) -> i32 { 0 } } ) . unwrap( ) . and_then( |i| {
85
86
match i. node {
86
87
ItemKind :: Trait ( _, _, _, mut items) => {
@@ -89,7 +90,7 @@ fn expand_into_foo_multi(cx: &mut ExtCtxt,
89
90
_ => unreachable!( "trait parsed to something other than trait" )
90
91
}
91
92
} )
92
- }
93
+ ] ,
93
94
}
94
95
}
95
96
0 commit comments