@@ -4,15 +4,16 @@ use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
44use rustc_errors:: codes:: * ;
55use rustc_errors:: struct_span_code_err;
66use rustc_hir as hir;
7- use rustc_hir:: PolyTraitRef ;
7+ use rustc_hir:: attrs :: AttributeKind ;
88use rustc_hir:: def:: { DefKind , Res } ;
99use rustc_hir:: def_id:: { CRATE_DEF_ID , DefId } ;
10+ use rustc_hir:: { PolyTraitRef , find_attr} ;
1011use rustc_middle:: bug;
1112use rustc_middle:: ty:: {
1213 self as ty, IsSuggestable , Ty , TyCtxt , TypeSuperVisitable , TypeVisitable , TypeVisitableExt ,
1314 TypeVisitor , Upcast ,
1415} ;
15- use rustc_span:: { ErrorGuaranteed , Ident , Span , kw, sym } ;
16+ use rustc_span:: { ErrorGuaranteed , Ident , Span , kw} ;
1617use rustc_trait_selection:: traits;
1718use smallvec:: SmallVec ;
1819use tracing:: { debug, instrument} ;
@@ -170,7 +171,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
170171 let tcx = self . tcx ( ) ;
171172
172173 // Skip adding any default bounds if `#![rustc_no_implicit_bounds]`
173- if tcx. has_attr ( CRATE_DEF_ID , sym :: rustc_no_implicit_bounds ) {
174+ if find_attr ! ( tcx. get_all_attrs ( CRATE_DEF_ID ) , AttributeKind :: RustcNoImplicitBounds ) {
174175 return ;
175176 }
176177
@@ -284,7 +285,8 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
284285 context : ImpliedBoundsContext < ' tcx > ,
285286 ) -> bool {
286287 let collected = collect_bounds ( hir_bounds, context, trait_def_id) ;
287- !self . tcx ( ) . has_attr ( CRATE_DEF_ID , sym:: rustc_no_implicit_bounds) && !collected. any ( )
288+ !find_attr ! ( self . tcx( ) . get_all_attrs( CRATE_DEF_ID ) , AttributeKind :: RustcNoImplicitBounds )
289+ && !collected. any ( )
288290 }
289291
290292 fn reject_duplicate_relaxed_bounds ( & self , relaxed_bounds : SmallVec < [ & PolyTraitRef < ' _ > ; 1 ] > ) {
0 commit comments