-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Prevent infinite recursion of modules #50305
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
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 |
b7c2028
to
fe2a570
Compare
src/librustdoc/clean/inline.rs
Outdated
@@ -401,7 +401,7 @@ fn build_module(cx: &DocContext, did: DefId) -> clean::Module { | |||
for &item in cx.tcx.item_children(did).iter() { | |||
let def_id = item.def.def_id(); | |||
if item.vis == ty::Visibility::Public { | |||
if !visited.insert(def_id) { continue } | |||
if did == def_id || !visited.insert(def_id) { continue } |
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.
This doesn't fix the original issue from #50196 which looks like:
pub mod tree {
pub mod prelude {
pub use tree;
}
}
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.
Good point. I'll store every def id instead to be sure the item isn't one of its parents.
fe2a570
to
b2b7510
Compare
Updated. |
Can you change your test (or add a new one) to use the sample @ollie27 provided? |
Ping from triage, @GuillaumeGomez ! You have some feedback to address! |
Indeed, will update soon. :) |
b2b7510
to
3ba7c00
Compare
Updated. |
Thanks! @bors r+ |
📌 Commit 3ba7c00 has been approved by |
…isdreavus Prevent infinite recursion of modules Fixes #50196. r? @QuietMisdreavus
☀️ Test successful - status-appveyor, status-travis |
Fixes #50196.
r? @QuietMisdreavus