-If this were the end of the story, naked functions would not be very useful. In order to re-enable access to the function arguments, the compiler ensures that the initial state of the registers in the `asm!()` statement conform to the function's calling convention. This allows hand-crafted assembly access to the function arguments through the calling convention. Since the `extern "Rust"` calling convention is undefined, its use is disallowed and an alternative, well-defined calling convention must be specified. Likewise, since the `asm!()` statement can access the function arguments through the calling convention, the arguments themselves must be FFI safe to ensure that they can be reliably accessed from assembly.
0 commit comments