@@ -5,10 +5,12 @@ use itertools::Itertools;
5
5
use rustc_hir:: def_id:: LocalDefId ;
6
6
use rustc_hir:: intravisit:: { Visitor , walk_block, walk_expr, walk_stmt} ;
7
7
use rustc_hir:: { BlockCheckMode , Expr , ExprKind , HirId , Stmt , UnsafeSource } ;
8
+ use rustc_hir:: attrs:: AttributeKind ;
9
+ use rustc_hir:: find_attr;
8
10
use rustc_lint:: { LateContext , LateLintPass , Level , LintContext } ;
9
11
use rustc_middle:: lint:: LevelAndSource ;
10
12
use rustc_session:: impl_lint_pass;
11
- use rustc_span:: { Span , SyntaxContext , sym } ;
13
+ use rustc_span:: { Span , SyntaxContext } ;
12
14
use std:: collections:: BTreeMap ;
13
15
use std:: collections:: btree_map:: Entry ;
14
16
@@ -146,7 +148,8 @@ struct BodyVisitor<'a, 'tcx> {
146
148
}
147
149
148
150
fn 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 { ..} ) )
150
153
&& !cx. tcx . is_doc_hidden ( def_id)
151
154
}
152
155
0 commit comments