Currently, the Rust compiler allows an exported extern function declaration and its function definition to have different argument counts or incompatible arguments.
This can cause unsound behaviour if the ABI is incompatible, or it is compatible, but the types are mismatched.
There is a discussion about detecting ABI incompatibilities, and linting when the ABI is compatible but the declaration is likely a mistake:
https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/Lint.20for.20comparing.20Rust.20signatures.20with.20C.20header.20files/near/590539789
Currently, the Rust compiler allows an exported extern function declaration and its function definition to have different argument counts or incompatible arguments.
This can cause unsound behaviour if the ABI is incompatible, or it is compatible, but the types are mismatched.
There is a discussion about detecting ABI incompatibilities, and linting when the ABI is compatible but the declaration is likely a mistake:
https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/Lint.20for.20comparing.20Rust.20signatures.20with.20C.20header.20files/near/590539789