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 {
140
140
}
141
141
}
142
142
143
+ #[ derive( Debug , Clone , Copy ) ]
143
144
pub struct AttrQuery < ' a > {
144
145
attrs : & ' a Attrs ,
145
146
key : & ' static str ,
Original file line number Diff line number Diff line change @@ -404,16 +404,20 @@ impl RawItemsCollector {
404
404
let ast_id = self . source_ast_id_map . ast_id ( & m) ;
405
405
406
406
// 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
+
417
421
let builtin = attrs. by_key ( "rustc_builtin_macro" ) . exists ( ) ;
418
422
419
423
let m = self . raw_items . macros . alloc ( MacroData {
You can’t perform that action at this time.
0 commit comments