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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
245 B
Rust
Raw Normal View History

2020-09-02 05:12:52 +08:00
extern "C" {
fn foo(a: i32, ...);
}
fn bar(_: *const u8) {}
fn main() {
unsafe {
foo(0, bar);
2018-01-23 00:35:21 +08:00
//~^ ERROR can't pass `fn(*const u8) {bar}` to variadic function
//~| HELP cast the value to `fn(*const u8)`
}
}