@@ -655,25 +655,20 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
655655 // llvm/llvm-project#70563).
656656 if !codegen_fn_attrs. target_features . is_empty ( )
657657 && matches ! ( codegen_fn_attrs. inline, InlineAttr :: Always )
658+ && let Some ( span) = inline_span
658659 {
659- if let Some ( span) = inline_span {
660- tcx. dcx ( ) . span_err ( span, "cannot use `#[inline(always)]` with `#[target_feature]`" ) ;
661- }
660+ tcx. dcx ( ) . span_err ( span, "cannot use `#[inline(always)]` with `#[target_feature]`" ) ;
662661 }
663662
664- if !codegen_fn_attrs. no_sanitize . is_empty ( ) && codegen_fn_attrs. inline . always ( ) {
665- if let ( Some ( no_sanitize_span) , Some ( inline_span) ) = ( no_sanitize_span, inline_span) {
666- let hir_id = tcx. local_def_id_to_hir_id ( did) ;
667- tcx. node_span_lint (
668- lint:: builtin:: INLINE_NO_SANITIZE ,
669- hir_id,
670- no_sanitize_span,
671- |lint| {
672- lint. primary_message ( "`no_sanitize` will have no effect after inlining" ) ;
673- lint. span_note ( inline_span, "inlining requested here" ) ;
674- } ,
675- )
676- }
663+ if !codegen_fn_attrs. no_sanitize . is_empty ( )
664+ && codegen_fn_attrs. inline . always ( )
665+ && let ( Some ( no_sanitize_span) , Some ( inline_span) ) = ( no_sanitize_span, inline_span)
666+ {
667+ let hir_id = tcx. local_def_id_to_hir_id ( did) ;
668+ tcx. node_span_lint ( lint:: builtin:: INLINE_NO_SANITIZE , hir_id, no_sanitize_span, |lint| {
669+ lint. primary_message ( "`no_sanitize` will have no effect after inlining" ) ;
670+ lint. span_note ( inline_span, "inlining requested here" ) ;
671+ } )
677672 }
678673
679674 // Weak lang items have the same semantics as "std internal" symbols in the
@@ -703,10 +698,10 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
703698 // Any linkage to LLVM intrinsics for now forcibly marks them all as never
704699 // unwinds since LLVM sometimes can't handle codegen which `invoke`s
705700 // intrinsic functions.
706- if let Some ( name) = & codegen_fn_attrs. link_name {
707- if name. as_str ( ) . starts_with ( "llvm." ) {
708- codegen_fn_attrs . flags |= CodegenFnAttrFlags :: NEVER_UNWIND ;
709- }
701+ if let Some ( name) = & codegen_fn_attrs. link_name
702+ && name. as_str ( ) . starts_with ( "llvm." )
703+ {
704+ codegen_fn_attrs . flags |= CodegenFnAttrFlags :: NEVER_UNWIND ;
710705 }
711706
712707 if let Some ( features) = check_tied_features (
0 commit comments