rust/tests/fail/function_calls/exported_symbol_shim_clashing.rs
2022-07-11 11:48:56 +00:00

16 lines
360 B
Rust

#[no_mangle]
extern "C" fn malloc(_: usize) -> *mut std::ffi::c_void {
//~^ HELP: the `malloc` symbol is defined here
unreachable!()
}
fn main() {
extern "C" {
fn malloc(_: usize) -> *mut std::ffi::c_void;
}
unsafe {
malloc(0);
//~^ ERROR: found `malloc` symbol definition that clashes with a built-in shim
}
}