RS.CLIPPY.NO_MANGLE_WITH_RUST_ABI
Convert Rust ABI functions to C ABI
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: no_mangle_with_rust_abi. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for Rust ABI functions with the #[no_mangle] attribute.
Why is this bad?
The Rust ABI is not stable, but in many simple cases matches
enough with the C ABI that it is possible to forget to add
extern "C" to a function called from C. Changes to the
Rust ABI can break this at any point.
Example
#[no_mangle]
fn example(arg_one: u32, arg_two: usize) {}
Use instead:
#[no_mangle]
extern "C" fn example(arg_one: u32, arg_two: usize) {}