From b9a0e57b0cce981460595598ee74c1cd55049377 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 23 Nov 2024 16:42:20 +0100 Subject: add a test for target-feature-ABI warnings in closures --- compiler/rustc_codegen_ssa/src/codegen_attrs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_codegen_ssa/src/codegen_attrs.rs') 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 + // . // // 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 -- cgit 1.4.1-3-g733a5