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