@@ -2,6 +2,7 @@ use std::iter;
22use std:: ops:: ControlFlow ;
33
44use rustc_abi:: ExternAbi ;
5+ use rustc_attr_data_structures:: { AttributeKind , find_attr} ;
56use rustc_data_structures:: fx:: { FxIndexMap , FxIndexSet } ;
67use rustc_hir as hir;
78use rustc_hir:: def:: DefKind ;
@@ -14,7 +15,7 @@ use rustc_middle::ty::{
1415 self , Ty , TyCtxt , TypeSuperVisitable , TypeVisitable , TypeVisitor , Visibility ,
1516} ;
1617use rustc_session:: config:: CrateType ;
17- use rustc_span:: { Span , sym } ;
18+ use rustc_span:: Span ;
1819
1920use crate :: errors:: UnexportableItem ;
2021
@@ -44,7 +45,7 @@ impl<'tcx> ExportableItemCollector<'tcx> {
4445 }
4546
4647 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 ) ;
4849 if !self . in_exportable_mod && !has_attr {
4950 return false ;
5051 }
@@ -80,7 +81,7 @@ impl<'tcx> ExportableItemCollector<'tcx> {
8081 fn walk_item_with_mod ( & mut self , item : & ' tcx hir:: Item < ' tcx > ) {
8182 let def_id = item. hir_id ( ) . owner . def_id ;
8283 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 ) {
8485 self . in_exportable_mod = true ;
8586 }
8687 let old_seen_exportable_in_mod = std:: mem:: replace ( & mut self . seen_exportable_in_mod , false ) ;
0 commit comments