@@ -2,6 +2,7 @@ use std::iter;
2
2
use std:: ops:: ControlFlow ;
3
3
4
4
use rustc_abi:: ExternAbi ;
5
+ use rustc_attr_data_structures:: { AttributeKind , find_attr} ;
5
6
use rustc_data_structures:: fx:: { FxIndexMap , FxIndexSet } ;
6
7
use rustc_hir as hir;
7
8
use rustc_hir:: def:: DefKind ;
@@ -14,7 +15,7 @@ use rustc_middle::ty::{
14
15
self , Ty , TyCtxt , TypeSuperVisitable , TypeVisitable , TypeVisitor , Visibility ,
15
16
} ;
16
17
use rustc_session:: config:: CrateType ;
17
- use rustc_span:: { Span , sym } ;
18
+ use rustc_span:: Span ;
18
19
19
20
use crate :: errors:: UnexportableItem ;
20
21
@@ -44,7 +45,7 @@ impl<'tcx> ExportableItemCollector<'tcx> {
44
45
}
45
46
46
47
fn item_is_exportable ( & self , def_id : LocalDefId ) -> bool {
47
- let has_attr = self . tcx . has_attr ( def_id, sym :: export_stable ) ;
48
+ let has_attr = find_attr ! ( self . tcx. get_all_attrs ( def_id) , AttributeKind :: ExportStable ) ;
48
49
if !self . in_exportable_mod && !has_attr {
49
50
return false ;
50
51
}
@@ -80,7 +81,7 @@ impl<'tcx> ExportableItemCollector<'tcx> {
80
81
fn walk_item_with_mod ( & mut self , item : & ' tcx hir:: Item < ' tcx > ) {
81
82
let def_id = item. hir_id ( ) . owner . def_id ;
82
83
let old_exportable_mod = self . in_exportable_mod ;
83
- if self . tcx . get_attr ( def_id, sym :: export_stable ) . is_some ( ) {
84
+ if find_attr ! ( self . tcx. get_all_attrs ( def_id) , AttributeKind :: ExportStable ) {
84
85
self . in_exportable_mod = true ;
85
86
}
86
87
let old_seen_exportable_in_mod = std:: mem:: replace ( & mut self . seen_exportable_in_mod , false ) ;
0 commit comments