store the span of the nested part of the use tree in the ast

This commit is contained in:
Pietro Albini
2024-04-02 00:26:10 +02:00
parent 2ec337c193
commit 13f76235b3
17 changed files with 45 additions and 36 deletions

View File

@@ -2332,8 +2332,8 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
None => {}
}
}
} else if let UseTreeKind::Nested(use_trees) = &use_tree.kind {
for (use_tree, _) in use_trees {
} else if let UseTreeKind::Nested { items, .. } = &use_tree.kind {
for (use_tree, _) in items {
self.future_proof_import(use_tree);
}
}
@@ -2510,7 +2510,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
ItemKind::Use(ref use_tree) => {
let maybe_exported = match use_tree.kind {
UseTreeKind::Simple(_) | UseTreeKind::Glob => MaybeExported::Ok(item.id),
UseTreeKind::Nested(_) => MaybeExported::NestedUse(&item.vis),
UseTreeKind::Nested { .. } => MaybeExported::NestedUse(&item.vis),
};
self.resolve_doc_links(&item.attrs, maybe_exported);