Rollup merge of #96989 - cjgillot:defpath-use, r=davidtwco
Be more precise than DefPathData::Misc. This variant was used for two unrelated things. Let's make this cleaner.
This commit is contained in:
commit
f2100daf32
11 changed files with 116 additions and 41 deletions
|
@ -109,7 +109,7 @@ impl<'a, 'b> visit::Visitor<'a> for DefCollector<'a, 'b> {
|
|||
visit::walk_item(self, i);
|
||||
return self.visit_macro_invoc(i.id);
|
||||
}
|
||||
ItemKind::GlobalAsm(..) => DefPathData::Misc,
|
||||
ItemKind::GlobalAsm(..) => DefPathData::GlobalAsm,
|
||||
ItemKind::Use(..) => {
|
||||
return visit::walk_item(self, i);
|
||||
}
|
||||
|
@ -160,11 +160,11 @@ impl<'a, 'b> visit::Visitor<'a> for DefCollector<'a, 'b> {
|
|||
}
|
||||
|
||||
fn visit_use_tree(&mut self, use_tree: &'a UseTree, id: NodeId, _nested: bool) {
|
||||
self.create_def(id, DefPathData::Misc, use_tree.span);
|
||||
self.create_def(id, DefPathData::Use, use_tree.span);
|
||||
match use_tree.kind {
|
||||
UseTreeKind::Simple(_, id1, id2) => {
|
||||
self.create_def(id1, DefPathData::Misc, use_tree.prefix.span);
|
||||
self.create_def(id2, DefPathData::Misc, use_tree.prefix.span);
|
||||
self.create_def(id1, DefPathData::Use, use_tree.prefix.span);
|
||||
self.create_def(id2, DefPathData::Use, use_tree.prefix.span);
|
||||
}
|
||||
UseTreeKind::Glob => (),
|
||||
UseTreeKind::Nested(..) => {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue