@@ -139,14 +139,13 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
139
139
// information we encapsulate into, the better
140
140
let def_data = match i. node {
141
141
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 ( ) ) ,
147
142
ItemKind :: Mod ( ..) if i. ident == keywords:: Invalid . ident ( ) => {
148
143
return visit:: walk_item ( self , i) ;
149
144
}
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 ( ) ) ,
150
149
ItemKind :: Fn (
151
150
ref decl,
152
151
ref header,
@@ -163,7 +162,6 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
163
162
body,
164
163
)
165
164
}
166
- ItemKind :: Mod ( ..) => DefPathData :: Module ( i. ident . as_interned_str ( ) ) ,
167
165
ItemKind :: Static ( ..) | ItemKind :: Const ( ..) | ItemKind :: Fn ( ..) =>
168
166
DefPathData :: ValueNs ( i. ident . as_interned_str ( ) ) ,
169
167
ItemKind :: MacroDef ( ..) => DefPathData :: MacroDef ( i. ident . as_interned_str ( ) ) ,
@@ -211,7 +209,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
211
209
212
210
fn visit_variant ( & mut self , v : & ' a Variant , g : & ' a Generics , item_id : NodeId ) {
213
211
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 ( ) ) ,
215
213
REGULAR_SPACE ,
216
214
v. span ) ;
217
215
self . with_parent ( def, |this| {
@@ -239,7 +237,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
239
237
let name = param. ident . as_interned_str ( ) ;
240
238
let def_path_data = match param. kind {
241
239
GenericParamKind :: Lifetime { .. } => DefPathData :: LifetimeParam ( name) ,
242
- GenericParamKind :: Type { .. } => DefPathData :: TypeParam ( name) ,
240
+ GenericParamKind :: Type { .. } => DefPathData :: TypeNs ( name) ,
243
241
GenericParamKind :: Const { .. } => DefPathData :: ConstParam ( name) ,
244
242
} ;
245
243
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> {
252
250
TraitItemKind :: Method ( ..) | TraitItemKind :: Const ( ..) =>
253
251
DefPathData :: ValueNs ( ti. ident . as_interned_str ( ) ) ,
254
252
TraitItemKind :: Type ( ..) => {
255
- DefPathData :: AssocTypeInTrait ( ti. ident . as_interned_str ( ) )
253
+ DefPathData :: TypeNs ( ti. ident . as_interned_str ( ) )
256
254
} ,
257
255
TraitItemKind :: Macro ( ..) => return self . visit_macro_invoc ( ti. id ) ,
258
256
} ;
@@ -279,9 +277,9 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
279
277
}
280
278
ImplItemKind :: Method ( ..) | ImplItemKind :: Const ( ..) =>
281
279
DefPathData :: ValueNs ( ii. ident . as_interned_str ( ) ) ,
282
- ImplItemKind :: Type ( ..) => DefPathData :: AssocTypeInImpl ( ii . ident . as_interned_str ( ) ) ,
280
+ ImplItemKind :: Type ( ..) |
283
281
ImplItemKind :: Existential ( ..) => {
284
- DefPathData :: AssocExistentialInImpl ( ii. ident . as_interned_str ( ) )
282
+ DefPathData :: TypeNs ( ii. ident . as_interned_str ( ) )
285
283
} ,
286
284
ImplItemKind :: Macro ( ..) => return self . visit_macro_invoc ( ii. id ) ,
287
285
} ;
0 commit comments