Skip to content

Commit bf644e9

Browse files
committed
Use codegen_fn_attrs to check if function is naked.
1 parent c0c4898 commit bf644e9

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_hir_typeck/src

1 file changed

+3
-3
lines changed

compiler/rustc_hir_typeck/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ use rustc_data_structures::unord::UnordSet;
4646
use rustc_errors::codes::*;
4747
use rustc_errors::{Applicability, ErrorGuaranteed, pluralize, struct_span_code_err};
4848
use rustc_hir as hir;
49-
use rustc_hir::attrs::AttributeKind;
5049
use rustc_hir::def::{DefKind, Res};
51-
use rustc_hir::{HirId, HirIdMap, Node, find_attr};
50+
use rustc_hir::{HirId, HirIdMap, Node};
5251
use rustc_hir_analysis::check::{check_abi, check_custom_abi};
5352
use rustc_hir_analysis::hir_ty_lowering::HirTyLowerer;
5453
use rustc_infer::traits::{ObligationCauseCode, ObligationInspector, WellFormedLoc};
54+
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
5555
use rustc_middle::query::Providers;
5656
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt};
5757
use rustc_middle::{bug, span_bug};
@@ -174,7 +174,7 @@ fn typeck_with_inspect<'tcx>(
174174
.map(|(idx, ty)| fcx.normalize(arg_span(idx), ty)),
175175
);
176176

177-
if find_attr!(tcx.get_all_attrs(def_id), AttributeKind::Naked(..)) {
177+
if tcx.codegen_fn_attrs(def_id).flags.contains(CodegenFnAttrFlags::NAKED) {
178178
naked_functions::typeck_naked_fn(tcx, def_id, body);
179179
}
180180

0 commit comments

Comments
 (0)