]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/function_calls/exported_symbol_shim_clashing.rs
Auto merge of #100848 - xfix:use-metadata-for-slice-len, r=thomcc
[rust.git] / src / tools / miri / tests / fail / function_calls / exported_symbol_shim_clashing.rs
1 #[no_mangle]
2 extern "C" fn malloc(_: usize) -> *mut std::ffi::c_void {
3     //~^ HELP: the `malloc` symbol is defined here
4     unreachable!()
5 }
6
7 fn main() {
8     extern "C" {
9         fn malloc(_: usize) -> *mut std::ffi::c_void;
10     }
11     unsafe {
12         malloc(0);
13         //~^ ERROR: found `malloc` symbol definition that clashes with a built-in shim
14     }
15 }