about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-11-25 00:39:06 +0800
committerGitHub <noreply@github.com>2024-11-25 00:39:06 +0800
commitc50e19b69cf7f26fcd289c32a4f69adda5bc9470 (patch)
treeb0b6551f9e4eec414d02ef3c6ff95a885c29b216 /compiler/rustc_codegen_ssa/src/codegen_attrs.rs
parent1741b394da9818aea67deb66a2b5cf4ddc2a1440 (diff)
parent3440505ec8939e9f7d14f98f356bea588543db69 (diff)
downloadrust-c50e19b69cf7f26fcd289c32a4f69adda5bc9470.tar.gz
rust-c50e19b69cf7f26fcd289c32a4f69adda5bc9470.zip
Rollup merge of #133384 - RalfJung:vector-abi-check-tests, r=jieyouxu
add a test for target-feature-ABI warnings in closures and when calling extern fn

Also update the comment regarding the inheritance of target features into closures, to make it more clear that we really shouldn't do this right now.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/codegen_attrs.rs')
-rw-r--r--compiler/rustc_codegen_ssa/src/codegen_attrs.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
index 32e9422e005..a5acd8170ab 100644
--- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
+++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
@@ -576,9 +576,9 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
     // If this closure is marked `#[inline(always)]`, simply skip adding `#[target_feature]`.
     //
     // At this point, `unsafe` has already been checked and `#[target_feature]` only affects codegen.
-    // Emitting both `#[inline(always)]` and `#[target_feature]` can potentially result in an
-    // ICE, because LLVM errors when the function fails to be inlined due to a target feature
-    // mismatch.
+    // Due to LLVM limitations, emitting both `#[inline(always)]` and `#[target_feature]` is *unsound*:
+    // the function may be inlined into a caller with fewer target features. Also see
+    // <https://github.com/rust-lang/rust/issues/116573>.
     //
     // Using `#[inline(always)]` implies that this closure will most likely be inlined into
     // its parent function, which effectively inherits the features anyway. Boxing this closure