-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_macros
are exported....Yeah. For some historical reason, all
macro
macros are marked as exported, regardless of whether they actually are, which is dreadfully confusing. It would be more accurate to say thatexported_macros
currently contains only macros that have paths.This PR renames
exported_macros
toimportable_macros
, since these macros can be imported withuse
while others cannot. It also fixes the code above to no longer lint on privatemacro
macros, since themissing_docs
lint should only appear on exported items.Fixes #57569.