Remove missing_docs lint on private 2.0 macros#86968
Conversation
|
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
Other macros can also be imported with |
This field contains both 2.0 macros and exported macro_rules! macros. Pardon me if that was unclear, I think I explained it rather poorly. Procedural macros are also importable, but at the same time, they're exported too. I'm not entirely sure whether they're currently placed in exported_macros or not. Still, it would seem to me that this is strictly more correct and less confusing than the current system? Or am I missing something? I looked at making macro items work like other items, but that's well above my pay grade. |
oli-obk
left a comment
There was a problem hiding this comment.
I suggest avoiding renaming in this PR.
I don't have an opinion here, so let's keep the original name and figure out the details on renaming in an issue or zulip thread.
btw, thanks for doing this commit-by-commit, this PR was great to review.
Alright! Which would be better, an issue or a Zulip thread? I can do either.
Thank you! |
881179b to
b49936c
Compare
|
Alright, the changes are done! I force-pushed to remove the commit that did the rename and adjust the other commits accordingly. My new changes are in b49936c. I made that addition to the comment, as well as changing the code to apply the exported check to |
for discussion, probably a zulip thread Let's move this PR on then: @bors r+ |
|
📌 Commit b49936c has been approved by |
|
☀️ Test successful - checks-actions |
rust/compiler/rustc_lint/src/builtin.rs
Lines 573 to 584 in 798baeb
This code is the source of #57569. The problem is subtle, so let me point it out. This code makes the mistake of assuming that all of the macros in
krate.exported_macrosare exported....Yeah. For some historical reason, all
macromacros are marked as exported, regardless of whether they actually are, which is dreadfully confusing. It would be more accurate to say thatexported_macroscurrently contains only macros that have paths.This PR renames
exported_macrostoimportable_macros, since these macros can be imported withusewhile others cannot. It also fixes the code above to no longer lint on privatemacromacros, since themissing_docslint should only appear on exported items.Fixes #57569.