Skip to content

Commit 5b7b91c

Browse files
Only add into view_item_stack if the item will be inlined
1 parent 24c0b81 commit 5b7b91c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustdoc/visit_ast.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,6 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
265265
return false;
266266
}
267267

268-
if !self.view_item_stack.insert(res_did) {
269-
return false;
270-
}
271-
272268
if !please_inline &&
273269
let mut visitor = OneLevelVisitor::new(self.cx.tcx.hir(), res_did) &&
274270
let Some(item) = visitor.find_target(self.cx.tcx, def_id.to_def_id(), path) &&
@@ -285,6 +281,10 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
285281
return false;
286282
}
287283

284+
if !self.view_item_stack.insert(res_did) {
285+
return false;
286+
}
287+
288288
let ret = match tcx.hir().get_by_def_id(res_did) {
289289
Node::Item(&hir::Item { kind: hir::ItemKind::Mod(ref m), .. }) if glob => {
290290
let prev = mem::replace(&mut self.inlining, true);

0 commit comments

Comments
 (0)