Skip to content

Commit 2efeb48

Browse files
committed
rustc: collapse relevant DefPathData variants into ValueNs.
1 parent e5b9f54 commit 2efeb48

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

src/librustc/hir/map/def_collector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
226226
let name = field.ident.map(|ident| ident.name)
227227
.unwrap_or_else(|| Symbol::intern(&index.to_string()));
228228
let def = self.create_def(field.id,
229-
DefPathData::Field(name.as_interned_str()),
229+
DefPathData::ValueNs(name.as_interned_str()),
230230
REGULAR_SPACE,
231231
field.span);
232232
self.with_parent(def, |this| this.visit_struct_field(field));
@@ -238,7 +238,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
238238
let def_path_data = match param.kind {
239239
GenericParamKind::Lifetime { .. } => DefPathData::LifetimeParam(name),
240240
GenericParamKind::Type { .. } => DefPathData::TypeNs(name),
241-
GenericParamKind::Const { .. } => DefPathData::ConstParam(name),
241+
GenericParamKind::Const { .. } => DefPathData::ValueNs(name),
242242
};
243243
self.create_def(param.id, def_path_data, REGULAR_SPACE, param.ident.span);
244244

src/librustc/hir/map/definitions.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,6 @@ pub enum DefPathData {
348348
// Subportions of items
349349
/// A lifetime (generic) parameter
350350
LifetimeParam(InternedString),
351-
/// A const (generic) parameter
352-
ConstParam(InternedString),
353-
/// A struct field
354-
Field(InternedString),
355351
/// Implicit ctor for a unit or tuple-like struct or enum variant.
356352
Ctor,
357353
/// A constant expression (see {ast,hir}::AnonConst).
@@ -620,8 +616,6 @@ impl DefPathData {
620616
ValueNs(name) |
621617
MacroDef(name) |
622618
LifetimeParam(name) |
623-
ConstParam(name) |
624-
Field(name) |
625619
GlobalMetaData(name) => Some(name),
626620

627621
Impl |
@@ -641,8 +635,6 @@ impl DefPathData {
641635
ValueNs(name) |
642636
MacroDef(name) |
643637
LifetimeParam(name) |
644-
ConstParam(name) |
645-
Field(name) |
646638
GlobalMetaData(name) => {
647639
return name
648640
}

src/librustc/ty/print/pretty.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,9 +859,7 @@ impl TyCtxt<'_, '_, '_> {
859859
fn guess_def_namespace(self, def_id: DefId) -> Namespace {
860860
match self.def_key(def_id).disambiguated_data.data {
861861
DefPathData::ValueNs(..) |
862-
DefPathData::Field(..) |
863862
DefPathData::AnonConst |
864-
DefPathData::ConstParam(..) |
865863
DefPathData::ClosureExpr |
866864
DefPathData::Ctor => Namespace::ValueNS,
867865

0 commit comments

Comments
 (0)