To generate code for extern "C" fn foo(), rustc will create a Rust function and wrap it inside a function exposing the C ABI. This is bad for compile-time, but more importantly it makes it very hard to write functions like memset, memcpy and memmove for freestanding Rust because LLVM will kindly replace their body with a call to the intrinsic, and then lower that to an infinitely recursive function.
https://github.com/thestinger/rust-core#freestanding
To generate code for
extern "C" fn foo(),rustcwill create a Rust function and wrap it inside a function exposing the C ABI. This is bad for compile-time, but more importantly it makes it very hard to write functions likememset,memcpyandmemmovefor freestanding Rust because LLVM will kindly replace their body with a call to the intrinsic, and then lower that to an infinitely recursive function.https://github.com/thestinger/rust-core#freestanding