@@ -24,7 +24,6 @@ use itertools::Itertools;
2424use rustc_abi:: { ExternAbi , FieldIdx } ;
2525use rustc_apfloat:: Float ;
2626use rustc_apfloat:: ieee:: { Double , Half , Quad , Single } ;
27- use rustc_ast:: attr;
2827use rustc_data_structures:: fx:: FxHashMap ;
2928use rustc_data_structures:: sorted_map:: SortedIndexMultiMap ;
3029use rustc_errors:: ErrorGuaranteed ;
@@ -41,7 +40,7 @@ use rustc_middle::thir::{self, ExprId, LocalVarId, Param, ParamId, PatKind, Thir
4140use rustc_middle:: ty:: { self , ScalarInt , Ty , TyCtxt , TypeVisitableExt , TypingMode } ;
4241use rustc_middle:: { bug, span_bug} ;
4342use rustc_session:: lint;
44- use rustc_span:: { Span , Symbol , sym } ;
43+ use rustc_span:: { Span , Symbol } ;
4544
4645use crate :: builder:: expr:: as_place:: PlaceBuilder ;
4746use crate :: builder:: scope:: { DropKind , LintLevel } ;
@@ -751,11 +750,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
751750 coroutine : Option < Box < CoroutineInfo < ' tcx > > > ,
752751 ) -> Builder < ' a , ' tcx > {
753752 let tcx = infcx. tcx ;
754- let attrs = tcx. hir_attrs ( hir_id) ;
755753 // Some functions always have overflow checks enabled,
756754 // however, they may not get codegen'd, depending on
757755 // the settings for the crate they are codegened in.
758- let mut check_overflow = attr :: contains_name ( attrs , sym :: rustc_inherit_overflow_checks ) ;
756+ let mut check_overflow = find_attr ! ( tcx . hir_attrs ( hir_id ) , RustcInheritOverflowChecks ) ;
759757 // Respect -C overflow-checks.
760758 check_overflow |= tcx. sess . overflow_checks ( ) ;
761759 // Constants always need overflow checks.
0 commit comments