We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18890f0 commit b8c44faCopy full SHA for b8c44fa
src/librustdoc/clean/mod.rs
@@ -2112,10 +2112,12 @@ fn get_all_import_attributes<'hir>(
2112
) {
2113
let hir_map = tcx.hir();
2114
let mut visitor = OneLevelVisitor::new(hir_map, target_def_id);
2115
+ let mut visited = FxHashSet::default();
2116
// If the item is an import and has at least a path with two parts, we go into it.
2117
while let hir::ItemKind::Use(path, _) = item.kind &&
2118
path.segments.len() > 1 &&
- let hir::def::Res::Def(_, def_id) = path.segments[path.segments.len() - 2].res
2119
+ let hir::def::Res::Def(_, def_id) = path.segments[path.segments.len() - 2].res &&
2120
+ visited.insert(def_id)
2121
{
2122
if let Some(hir::Node::Item(parent_item)) = hir_map.get_if_local(def_id) {
2123
// We add the attributes from this import into the list.
0 commit comments