]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #86376 - asquared31415:extern-no-mangle-84204, r=Mark-Simulacrum
authorMara Bos <m-ou.se@m-ou.se>
Wed, 1 Sep 2021 07:23:22 +0000 (09:23 +0200)
committerGitHub <noreply@github.com>
Wed, 1 Sep 2021 07:23:22 +0000 (09:23 +0200)
commitdcefd6871d40612e924bb63f5d8a3bddf934c0f4
tree953aa1266c594791fe1cffcd77bf5fd70fc06e75
parentc4f26b15e37101c54829efab456922a53e3103ad
parentfc125a52ec3a342c91ca399cafaeb0504a253991
Rollup merge of #86376 - asquared31415:extern-no-mangle-84204, r=Mark-Simulacrum

Emit specific warning to clarify that `#[no_mangle]` should not be applied on foreign statics or functions

Foreign statics and foreign functions should not have `#[no_mangle]` applied, as it does nothing to the name and has some extra hidden behavior that is normally unwanted.  There was an existing warning for this, but it says the attribute is only allowed on "statics or functions", which to the user can be confusing.

This PR adds a specific version of the unused `#[no_mangle]` warning that explains that the target is a *foreign* static or function and that they do not need the attribute.

Fixes #78989