Repository navigation
Error on wrong targets for no_mangle and export_name - #164789
JonathanBrouwer wants to merge 2 commits into
Conversation
c344658 to
5c4119b
Compare
|
This needs a crater run |
This comment has been minimized.
This comment has been minimized.
Error on wrong targets for `no_mangle` and `export_name`,
no_mangle and export_name,no_mangle and export_name
This comment has been minimized.
This comment has been minimized.
5c4119b to
6717514
Compare
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
This comment has been minimized.
This comment has been minimized.
|
rustc_codegen_ssa has a bunch of code defending against invalid codegen attrs, being able to clean that up would be nice. (for example, #159374 adds some) |
|
☔ The latest upstream changes (presumably #164894) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
This PR makes applying the
#[no_mangle]and#[export_name]attributes an error, rather than a warning.It also makes applying the attributes to a provided trait function consistently an error.
This is necessary because the current behavior is very buggy, and it is not clear to me what the correct behavior should be.
History:
export_nameused to error on all targets except fields, arms, macro defs, and macro calls.no_manglehas always warned on invalid targets. It has always had buggy behaviour on provided trait functions.export_nameon provided trait functions. The behaviour is buggy.The specific changes this PR makes are:
export_namegoes from warning to error on fields, arms, macro defs, and macro callsexport_namegoes from allowed to error on provided trait functionsno_manglegoes from warning to error on all targets except the allowed targets: free functions, statics, inherent methods and trait impl methods.Fixes #164571
cc @mejrs