1
Fork 0

hir: Do not introduce dummy type names for extern blocks in def paths

Use a separate nameless `DefPathData` variant instead
This commit is contained in:
Vadim Petrochenkov 2021-12-17 16:45:15 +08:00
parent dde825db46
commit 0d61852cc5
8 changed files with 36 additions and 31 deletions

View file

@ -92,6 +92,7 @@ impl<'a, 'b> visit::Visitor<'a> for DefCollector<'a, 'b> {
// information we encapsulate into, the better
let def_data = match &i.kind {
ItemKind::Impl { .. } => DefPathData::Impl,
ItemKind::ForeignMod(..) => DefPathData::ForeignMod,
ItemKind::Mod(..)
| ItemKind::Trait(..)
| ItemKind::TraitAlias(..)
@ -99,7 +100,6 @@ impl<'a, 'b> visit::Visitor<'a> for DefCollector<'a, 'b> {
| ItemKind::Struct(..)
| ItemKind::Union(..)
| ItemKind::ExternCrate(..)
| ItemKind::ForeignMod(..)
| ItemKind::TyAlias(..) => DefPathData::TypeNs(i.ident.name),
ItemKind::Static(..) | ItemKind::Const(..) | ItemKind::Fn(..) => {
DefPathData::ValueNs(i.ident.name)