-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 rustdoc-specific is_import field from HIR #51288
Conversation
@bors r+ |
📌 Commit 7bf908a has been approved by |
Remove rustdoc-specific is_import field from HIR Fixes #47100. I believe that there is no need to check for the name being the same, as this part of rustdoc seems to be strictly interested in exploring "public modules." Re-exports from the same module cannot visit another module; and, re-exports cannot export items with a greater visibility than that item declares. Therefore, I think this code is either sufficient, or in fact does more than is necessary, depending on whether rustdoc cares about the re-export itself. r? @eddyb
💔 Test failed - status-travis |
This comment has been minimized.
This comment has been minimized.
7bf908a
to
0aa7784
Compare
I can't reproduce locally; repushed a rebased version. @bors r=eddyb |
📌 Commit 0aa7784 has been approved by |
⌛ Testing commit 0aa778427d8ea8840b46f862e42e0a5b00c9e784 with merge ecca3d484c50817a4db80ad28c9f8e8edc56ce75... |
💔 Test failed - status-travis |
This comment has been minimized.
This comment has been minimized.
⌛ Testing commit 0aa778427d8ea8840b46f862e42e0a5b00c9e784 with merge 3998a03c521b5b10d938de48f5c0b8f24135db30... |
💔 Test failed - status-travis |
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 |
@eddyb I'm getting the impression that Any thoughts on what I should do in addition to the existing code? It's also not clear to me that we need a condition -- wouldn't we just visit more than necessary if there wasn't a condition? |
@Mark-Simulacrum It wouldn't be listed in the exports if it were private, would it? |
src/librustdoc/visit_lib.rs
Outdated
@@ -68,7 +68,8 @@ impl<'a, 'tcx, 'rcx> LibEmbargoVisitor<'a, 'tcx, 'rcx> { | |||
} | |||
|
|||
for item in self.cx.tcx.item_children(def_id).iter() { | |||
if !item.is_import || item.vis == Visibility::Public { | |||
if self.cx.tcx.def_key(item.def.def_id()).parent.map_or(false, |d| d != def_id.index) || |
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.
Oh, you have the condition inverted - !is_import
means it was originally defined in that module, whereas d != def_id.index
means the parent isn't the module itself, which means it was originally defined elsewhere.
0aa7784
to
19e0b7d
Compare
@bors r=eddyb Inverted the condition. |
📌 Commit 19e0b7d has been approved by |
…=eddyb Remove rustdoc-specific is_import field from HIR Fixes rust-lang#47100. I believe that there is no need to check for the name being the same, as this part of rustdoc seems to be strictly interested in exploring "public modules." Re-exports from the same module cannot visit another module; and, re-exports cannot export items with a greater visibility than that item declares. Therefore, I think this code is either sufficient, or in fact does more than is necessary, depending on whether rustdoc cares about the re-export itself. r? @eddyb
Rollup of 6 pull requests Successful merges: - #51288 (Remove rustdoc-specific is_import field from HIR) - #51299 (const fn integer operations) - #51317 (Allow enabling incremental via config.toml) - #51323 (Generate br for all two target SwitchInts) - #51326 (Various minor slice iterator cleanups) - #51329 (Remove the unused `-Z trans-time-graph` flag.) Failed merges:
💥 Test timed out |
Fixes #47100.
I believe that there is no need to check for the name being the same, as this
part of rustdoc seems to be strictly interested in exploring "public modules."
Re-exports from the same module cannot visit another module; and, re-exports
cannot export items with a greater visibility than that item declares.
Therefore, I think this code is either sufficient, or in fact does more than
is necessary, depending on whether rustdoc cares about the re-export itself.
r? @eddyb