File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
rustc_codegen_cranelift/src/abi
rustc_codegen_ssa/src/mir Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -467,7 +467,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
467467 true
468468 } else {
469469 instance. is_some_and ( |inst| {
470- fx. tcx . codegen_fn_attrs ( inst. def_id ( ) ) . flags . contains ( CodegenFnAttrFlags :: COLD )
470+ fx. tcx . codegen_instance_attrs ( inst. def ) . flags . contains ( CodegenFnAttrFlags :: COLD )
471471 } )
472472 } ;
473473 if is_cold {
Original file line number Diff line number Diff line change @@ -200,10 +200,11 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
200200 let fn_ty = bx. fn_decl_backend_type ( fn_abi) ;
201201
202202 let fn_attrs = if bx. tcx ( ) . def_kind ( fx. instance . def_id ( ) ) . has_codegen_attrs ( ) {
203- Some ( bx. tcx ( ) . codegen_fn_attrs ( fx. instance . def_id ( ) ) )
203+ Some ( bx. tcx ( ) . codegen_instance_attrs ( fx. instance . def ) )
204204 } else {
205205 None
206206 } ;
207+ let fn_attrs = fn_attrs. as_deref ( ) ;
207208
208209 if !fn_abi. can_unwind {
209210 unwind = mir:: UnwindAction :: Unreachable ;
Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ impl<'tcx> Inliner<'tcx> for ForceInliner<'tcx> {
248248 fn on_inline_failure ( & self , callsite : & CallSite < ' tcx > , reason : & ' static str ) {
249249 let tcx = self . tcx ( ) ;
250250 let InlineAttr :: Force { attr_span, reason : justification } =
251- tcx. codegen_fn_attrs ( callsite. callee . def_id ( ) ) . inline
251+ tcx. codegen_instance_attrs ( callsite. callee . def ) . inline
252252 else {
253253 bug ! ( "called on item without required inlining" ) ;
254254 } ;
@@ -606,7 +606,8 @@ fn try_inlining<'tcx, I: Inliner<'tcx>>(
606606 let tcx = inliner. tcx ( ) ;
607607 check_mir_is_available ( inliner, caller_body, callsite. callee ) ?;
608608
609- let callee_attrs = tcx. codegen_fn_attrs ( callsite. callee . def_id ( ) ) ;
609+ let callee_attrs = tcx. codegen_instance_attrs ( callsite. callee . def ) ;
610+ let callee_attrs = callee_attrs. as_ref ( ) ;
610611 check_inline:: is_inline_valid_on_fn ( tcx, callsite. callee . def_id ( ) ) ?;
611612 check_codegen_attributes ( inliner, callsite, callee_attrs) ?;
612613 inliner. check_codegen_attributes_extra ( callee_attrs) ?;
You can’t perform that action at this time.
0 commit comments