From a6207ec975abeb6132aeeede0d3895dbe1d877a8 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 5 Jun 2022 13:24:10 -0400 Subject: [PATCH] interpret: do not claim UB until we looked more into variadic functions --- compiler/rustc_const_eval/src/interpret/terminator.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/compiler/rustc_const_eval/src/interpret/terminator.rs b/compiler/rustc_const_eval/src/interpret/terminator.rs index 10da2f803af..57d06b48ca4 100644 --- a/compiler/rustc_const_eval/src/interpret/terminator.rs +++ b/compiler/rustc_const_eval/src/interpret/terminator.rs @@ -353,12 +353,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { // FIXME: for variadic support, do we have to somehow determine callee's extra_args? let callee_fn_abi = self.fn_abi_of_instance(instance, ty::List::empty())?; - if callee_fn_abi.c_variadic != caller_fn_abi.c_variadic { - throw_ub_format!( - "calling a c-variadic function via a non-variadic call site, or vice versa" - ); - } - if callee_fn_abi.c_variadic { + if callee_fn_abi.c_variadic || caller_fn_abi.c_variadic { throw_unsup_format!("calling a c-variadic function is not supported"); }