diff options
| author | Ralf Jung <post@ralfj.de> | 2022-06-05 13:24:10 -0400 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-06-05 13:24:24 -0400 |
| commit | a6207ec975abeb6132aeeede0d3895dbe1d877a8 (patch) | |
| tree | 25e1f450ab522530c30e2c5c7a57f64c18a4cd40 /compiler/rustc_const_eval/src/interpret | |
| parent | 4322a785cc99ea5fc81dd7f5fc8ba7f7a64b08ef (diff) | |
| download | rust-a6207ec975abeb6132aeeede0d3895dbe1d877a8.tar.gz rust-a6207ec975abeb6132aeeede0d3895dbe1d877a8.zip | |
interpret: do not claim UB until we looked more into variadic functions
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/terminator.rs | 7 |
1 files changed, 1 insertions, 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"); } |
