@@ -5,10 +5,12 @@ use itertools::Itertools;
55use rustc_hir:: def_id:: LocalDefId ;
66use rustc_hir:: intravisit:: { Visitor , walk_block, walk_expr, walk_stmt} ;
77use rustc_hir:: { BlockCheckMode , Expr , ExprKind , HirId , Stmt , UnsafeSource } ;
8+ use rustc_hir:: attrs:: AttributeKind ;
9+ use rustc_hir:: find_attr;
810use rustc_lint:: { LateContext , LateLintPass , Level , LintContext } ;
911use rustc_middle:: lint:: LevelAndSource ;
1012use rustc_session:: impl_lint_pass;
11- use rustc_span:: { Span , SyntaxContext , sym } ;
13+ use rustc_span:: { Span , SyntaxContext } ;
1214use std:: collections:: BTreeMap ;
1315use std:: collections:: btree_map:: Entry ;
1416
@@ -146,7 +148,8 @@ struct BodyVisitor<'a, 'tcx> {
146148}
147149
148150fn is_public_macro ( cx : & LateContext < ' _ > , def_id : LocalDefId ) -> bool {
149- ( cx. effective_visibilities . is_exported ( def_id) || cx. tcx . has_attr ( def_id, sym:: macro_export) )
151+ ( cx. effective_visibilities . is_exported ( def_id) ||
152+ find_attr ! ( cx. tcx. get_all_attrs( def_id) , AttributeKind :: MacroExport { ..} ) )
150153 && !cx. tcx . is_doc_hidden ( def_id)
151154}
152155
0 commit comments