about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2025-03-12 10:19:34 -0700
committerGitHub <noreply@github.com>2025-03-12 10:19:34 -0700
commit9d1b62c109273a4d49e2c786c3112830616dc273 (patch)
treeceb2f7882018f39d7406606d1990ca8d3340c4d4 /compiler/rustc_hir_analysis
parent8d28328049d1c571e2a4782e9c5fd7216d86487c (diff)
parentccdba16f42c951163d00c7e6cd7051be64d2f847 (diff)
downloadrust-9d1b62c109273a4d49e2c786c3112830616dc273.tar.gz
rust-9d1b62c109273a4d49e2c786c3112830616dc273.zip
Rollup merge of #138407 - Bryanskiy:delegation-variadic, r=petrochenkov
Delegation: reject C-variadics

The explanation is contained in attached issues.

Fixes https://github.com/rust-lang/rust/issues/127443
Fixes https://github.com/rust-lang/rust/issues/127413

r? `@petrochenkov`
Diffstat (limited to 'compiler/rustc_hir_analysis')
-rw-r--r--compiler/rustc_hir_analysis/src/delegation.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/delegation.rs b/compiler/rustc_hir_analysis/src/delegation.rs
index cb711ebb91a..78b20f9897c 100644
--- a/compiler/rustc_hir_analysis/src/delegation.rs
+++ b/compiler/rustc_hir_analysis/src/delegation.rs
@@ -409,6 +409,11 @@ fn check_constraints<'tcx>(
         emit("recursive delegation is not supported yet");
     }
 
+    if tcx.fn_sig(sig_id).skip_binder().skip_binder().c_variadic {
+        // See issue #127443 for explanation.
+        emit("delegation to C-variadic functions is not allowed");
+    }
+
     ret
 }