@@ -62,15 +62,16 @@ fn expand_identity(cx: &mut ExtCtxt, _span: Span, tts: &[TokenTree])
6262fn expand_into_foo_multi ( cx : & mut ExtCtxt ,
6363 sp : Span ,
6464 attr : & MetaItem ,
65- it : Annotatable ) -> Annotatable {
65+ it : Annotatable ) -> Vec < Annotatable > {
6666 match it {
67- Annotatable :: Item ( it) => {
67+ Annotatable :: Item ( it) => vec ! [
6868 Annotatable :: Item ( P ( Item {
6969 attrs: it. attrs. clone( ) ,
7070 ..( * 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 ! [
7475 quote_item!( cx, impl X { fn foo( & self ) -> i32 { 42 } } ) . unwrap( ) . and_then( |i| {
7576 match i. node {
7677 ItemKind :: Impl ( _, _, _, _, _, mut items) => {
@@ -79,8 +80,8 @@ fn expand_into_foo_multi(cx: &mut ExtCtxt,
7980 _ => unreachable!( "impl parsed to something other than impl" )
8081 }
8182 } )
82- }
83- Annotatable :: TraitItem ( it) => {
83+ ] ,
84+ Annotatable :: TraitItem ( it) => vec ! [
8485 quote_item!( cx, trait X { fn foo( & self ) -> i32 { 0 } } ) . unwrap( ) . and_then( |i| {
8586 match i. node {
8687 ItemKind :: Trait ( _, _, _, mut items) => {
@@ -89,7 +90,7 @@ fn expand_into_foo_multi(cx: &mut ExtCtxt,
8990 _ => unreachable!( "trait parsed to something other than trait" )
9091 }
9192 } )
92- }
93+ ] ,
9394 }
9495}
9596
0 commit comments