diff options
| author | James Barford-Evans <james.barford-evans@arm.com> | 2025-08-21 14:32:10 +0100 |
|---|---|---|
| committer | Jamie Cunliffe <Jamie.Cunliffe@arm.com> | 2025-08-27 14:45:01 +0100 |
| commit | bcfc9b5073a92bbb4b1e4db2eab535357d8973ad (patch) | |
| tree | a0bb4d26841b0c6a28ddb0dfea6b934f8e0f13ca /compiler/rustc_codegen_ssa/src | |
| parent | b2dd217dd0a099fb87601657ec480bf3e92b30a6 (diff) | |
| download | rust-bcfc9b5073a92bbb4b1e4db2eab535357d8973ad.tar.gz rust-bcfc9b5073a92bbb4b1e4db2eab535357d8973ad.zip | |
inline at the callsite & warn when target features mismatch
Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/codegen_attrs.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs index 961bb788149..008340e614d 100644 --- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs +++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs @@ -428,9 +428,16 @@ fn check_result( // llvm/llvm-project#70563). if !codegen_fn_attrs.target_features.is_empty() && matches!(codegen_fn_attrs.inline, InlineAttr::Always) + && !tcx.features().target_feature_inline_always() && let Some(span) = interesting_spans.inline { - tcx.dcx().span_err(span, "cannot use `#[inline(always)]` with `#[target_feature]`"); + feature_err( + tcx.sess, + sym::target_feature_inline_always, + span, + "cannot use `#[inline(always)]` with `#[target_feature]`", + ) + .emit(); } // warn that inline has no effect when no_sanitize is present |
