}
}
+ /// Dumps imports in a use tree recursively.
+ ///
+ /// A use tree is an import that may contain nested braces (RFC 2128). The `use_tree` parameter
+ /// is the current use tree under scrutiny, while `id` and `prefix` are its corresponding node
+ /// id and path. `root_item` is the topmost use tree in the hierarchy.
+ ///
+ /// If `use_tree` is a simple or glob import, it is dumped into the analysis data. Otherwise,
+ /// each child use tree is dumped recursively.
fn process_use_tree(&mut self,
use_tree: &'l ast::UseTree,
id: NodeId,
prefix: &ast::Path) {
let path = &use_tree.prefix;
let access = access_from!(self.save_ctxt, root_item);
+
+ // The parent def id of a given use tree is always the enclosing item.
let parent = self.save_ctxt.tcx.hir.opt_local_def_id(id)
.and_then(|id| self.save_ctxt.tcx.parent_def_id(id))
.map(::id_from_def_id);