@@ -139,14 +139,13 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
139139 // information we encapsulate into, the better
140140 let def_data = match i. node {
141141 ItemKind :: Impl ( ..) => DefPathData :: Impl ,
142- ItemKind :: Trait ( ..) => DefPathData :: Trait ( i. ident . as_interned_str ( ) ) ,
143- ItemKind :: TraitAlias ( ..) => DefPathData :: TraitAlias ( i. ident . as_interned_str ( ) ) ,
144- ItemKind :: Enum ( ..) | ItemKind :: Struct ( ..) | ItemKind :: Union ( ..) |
145- ItemKind :: Existential ( ..) | ItemKind :: ExternCrate ( ..) | ItemKind :: ForeignMod ( ..) |
146- ItemKind :: Ty ( ..) => DefPathData :: TypeNs ( i. ident . as_interned_str ( ) ) ,
147142 ItemKind :: Mod ( ..) if i. ident == keywords:: Invalid . ident ( ) => {
148143 return visit:: walk_item ( self , i) ;
149144 }
145+ ItemKind :: Mod ( ..) | ItemKind :: Trait ( ..) | ItemKind :: TraitAlias ( ..) |
146+ ItemKind :: Enum ( ..) | ItemKind :: Struct ( ..) | ItemKind :: Union ( ..) |
147+ ItemKind :: Existential ( ..) | ItemKind :: ExternCrate ( ..) | ItemKind :: ForeignMod ( ..) |
148+ ItemKind :: Ty ( ..) => DefPathData :: TypeNs ( i. ident . as_interned_str ( ) ) ,
150149 ItemKind :: Fn (
151150 ref decl,
152151 ref header,
@@ -163,7 +162,6 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
163162 body,
164163 )
165164 }
166- ItemKind :: Mod ( ..) => DefPathData :: Module ( i. ident . as_interned_str ( ) ) ,
167165 ItemKind :: Static ( ..) | ItemKind :: Const ( ..) | ItemKind :: Fn ( ..) =>
168166 DefPathData :: ValueNs ( i. ident . as_interned_str ( ) ) ,
169167 ItemKind :: MacroDef ( ..) => DefPathData :: MacroDef ( i. ident . as_interned_str ( ) ) ,
@@ -211,7 +209,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
211209
212210 fn visit_variant ( & mut self , v : & ' a Variant , g : & ' a Generics , item_id : NodeId ) {
213211 let def = self . create_def ( v. node . id ,
214- DefPathData :: EnumVariant ( v. node . ident . as_interned_str ( ) ) ,
212+ DefPathData :: TypeNs ( v. node . ident . as_interned_str ( ) ) ,
215213 REGULAR_SPACE ,
216214 v. span ) ;
217215 self . with_parent ( def, |this| {
@@ -239,7 +237,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
239237 let name = param. ident . as_interned_str ( ) ;
240238 let def_path_data = match param. kind {
241239 GenericParamKind :: Lifetime { .. } => DefPathData :: LifetimeParam ( name) ,
242- GenericParamKind :: Type { .. } => DefPathData :: TypeParam ( name) ,
240+ GenericParamKind :: Type { .. } => DefPathData :: TypeNs ( name) ,
243241 GenericParamKind :: Const { .. } => DefPathData :: ConstParam ( name) ,
244242 } ;
245243 self . create_def ( param. id , def_path_data, REGULAR_SPACE , param. ident . span ) ;
@@ -252,7 +250,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
252250 TraitItemKind :: Method ( ..) | TraitItemKind :: Const ( ..) =>
253251 DefPathData :: ValueNs ( ti. ident . as_interned_str ( ) ) ,
254252 TraitItemKind :: Type ( ..) => {
255- DefPathData :: AssocTypeInTrait ( ti. ident . as_interned_str ( ) )
253+ DefPathData :: TypeNs ( ti. ident . as_interned_str ( ) )
256254 } ,
257255 TraitItemKind :: Macro ( ..) => return self . visit_macro_invoc ( ti. id ) ,
258256 } ;
@@ -279,9 +277,9 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
279277 }
280278 ImplItemKind :: Method ( ..) | ImplItemKind :: Const ( ..) =>
281279 DefPathData :: ValueNs ( ii. ident . as_interned_str ( ) ) ,
282- ImplItemKind :: Type ( ..) => DefPathData :: AssocTypeInImpl ( ii . ident . as_interned_str ( ) ) ,
280+ ImplItemKind :: Type ( ..) |
283281 ImplItemKind :: Existential ( ..) => {
284- DefPathData :: AssocExistentialInImpl ( ii. ident . as_interned_str ( ) )
282+ DefPathData :: TypeNs ( ii. ident . as_interned_str ( ) )
285283 } ,
286284 ImplItemKind :: Macro ( ..) => return self . visit_macro_invoc ( ii. id ) ,
287285 } ;
0 commit comments