make #[no_mangle] and #[export_name] items always have external visibility#54414
make #[no_mangle] and #[export_name] items always have external visibility#54414japaric wants to merge 3 commits intorust-lang:masterfrom
Conversation
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
Thanks for this! I was actually starting a patch for this as well locally but kept not getting a chance to go back and keep testing it. I think though it's best to fix this by not touching privacy and only touching reachability, as that's basically what's happening here (this isn't messing with privacy, only reachability). I was planning on taking today to work on this, so I don't mind taking this over if you'd prefer! |
Please go ahead. This PR was me procrastinating on some writing I have to do, but it's best if I go back to writing. 😅 |
as discussed in #54135
this appears to work at least on bare functions and statics.
no_mangleon impl methods doesn't work (yet?). See example below:
After this change a few lints are no longer correct and would need to be
tweaked. e.g.
#[no_mangle] fn foo() {}is not dead code and doesn't need to bepubbut the compiler raises two warnings about that.r? @alexcrichton