Add new lint no_mangle_with_rust_abi by nindalf · Pull Request #10369 · rust-lang/rust-clippy (original) (raw)

Fixes issue #10347

This PR adds a new lint no_mangle_with_rust_abi that suggests converting a function to the C ABI to if the function has the #[no_mangle] attribute and Abi == Abi::Rust. It will not run for any of the other variants defined in rustc_target::spec::abi::Abi, nor suggest any conversion other than conversion to the C ABI.

Functions that explicitly opt into the Rust ABI with extern "Rust" are ignored by this lint.


changelog: [no_mangle_with_rust_abi]: add lint that converts Rust ABI functions with the #[no_mangle] attribute to C ABI