File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ impl Attr {
140140 }
141141}
142142
143+ #[ derive( Debug , Clone , Copy ) ]
143144pub struct AttrQuery < ' a > {
144145 attrs : & ' a Attrs ,
145146 key : & ' static str ,
Original file line number Diff line number Diff line change @@ -404,16 +404,20 @@ impl RawItemsCollector {
404404 let ast_id = self . source_ast_id_map . ast_id ( & m) ;
405405
406406 // FIXME: cfg_attr
407- let export = attrs. by_key ( "macro_export" ) . exists ( ) ;
408- let local_inner =
409- attrs. by_key ( "macro_export" ) . tt_values ( ) . map ( |it| & it. token_trees ) . flatten ( ) . any (
410- |it| match it {
411- tt:: TokenTree :: Leaf ( tt:: Leaf :: Ident ( ident) ) => {
412- ident. text . contains ( "local_inner_macros" )
413- }
414- _ => false ,
415- } ,
416- ) ;
407+ let export_attr = attrs. by_key ( "macro_export" ) ;
408+
409+ let export = export_attr. exists ( ) ;
410+ let local_inner = if export {
411+ export_attr. tt_values ( ) . map ( |it| & it. token_trees ) . flatten ( ) . any ( |it| match it {
412+ tt:: TokenTree :: Leaf ( tt:: Leaf :: Ident ( ident) ) => {
413+ ident. text . contains ( "local_inner_macros" )
414+ }
415+ _ => false ,
416+ } )
417+ } else {
418+ false
419+ } ;
420+
417421 let builtin = attrs. by_key ( "rustc_builtin_macro" ) . exists ( ) ;
418422
419423 let m = self . raw_items . macros . alloc ( MacroData {
You can’t perform that action at this time.
0 commit comments