Files
rust/tests/ui/explicit-tail-calls/c-variadic.rs
Folkert de Vries d28c31a600 c-variadic: check that c-variadic functions cannot be tail-called
as far as I can see this was not tested, though the error message was already implemented
2025-09-13 21:05:12 +02:00

15 lines
303 B
Rust

#![expect(incomplete_features)]
#![feature(c_variadic, explicit_tail_calls)]
#![allow(unused)]
unsafe extern "C" fn foo(mut ap: ...) -> u32 {
ap.arg::<u32>()
}
extern "C" fn bar() -> u32 {
unsafe { become foo(1, 2, 3) }
//~^ ERROR c-variadic functions can't be tail-called
}
fn main() {}