about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-02-23 19:41:03 +0000
committerbors <bors@rust-lang.org>2023-02-23 19:41:03 +0000
commit659112ca956c70e9983c9e1e3d1e3a7abec63110 (patch)
tree08d8e01f67dd9031f7bcd9b4f692134044962e2a /compiler/rustc_mir_transform/src/coverage/mod.rs
parentf9adb83e0a9a5d1e8f2c5a7fc5b95c698a56b0ad (diff)
parent00c294ad0599968ce81bdb8763aefb88a2d2faa0 (diff)
downloadrust-659112ca956c70e9983c9e1e3d1e3a7abec63110.tar.gz
rust-659112ca956c70e9983c9e1e3d1e3a7abec63110.zip
Auto merge of #10369 - nindalf:no_mangle_lint, r=llogiq
Add new lint no_mangle_with_rust_abi

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](https://doc.rust-lang.org/beta/nightly-rustc/rustc_target/spec/abi/enum.Abi.html), 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
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/mod.rs')
0 files changed, 0 insertions, 0 deletions