rust/tests/ui/c-variadic/issue-32201.rs

15 lines
351 B
Rust
Raw Normal View History

2020-09-01 21:12:52 +00:00
extern "C" {
fn foo(a: i32, ...);
}
fn bar(_: *const u8) {}
fn main() {
unsafe {
foo(0, bar);
2024-11-27 14:37:27 +00:00
//~^ ERROR can't pass a function item to a variadic function
//~| HELP a function item is zero-sized and needs to be cast into a function pointer to be used in FFI
////~| HELP use a function pointer instead
}
}