@@ -141,14 +141,13 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
141141 // information we encapsulate into, the better
142142 let def_data = match i. node {
143143 ItemKind :: Impl ( ..) => DefPathData :: Impl ,
144- ItemKind :: Trait ( ..) => DefPathData :: Trait ( i. ident . as_interned_str ( ) ) ,
145- ItemKind :: TraitAlias ( ..) => DefPathData :: TraitAlias ( i. ident . as_interned_str ( ) ) ,
146- ItemKind :: Enum ( ..) | ItemKind :: Struct ( ..) | ItemKind :: Union ( ..) |
147- ItemKind :: Existential ( ..) | ItemKind :: ExternCrate ( ..) | ItemKind :: ForeignMod ( ..) |
148- ItemKind :: Ty ( ..) => DefPathData :: TypeNs ( i. ident . as_interned_str ( ) ) ,
149144 ItemKind :: Mod ( ..) if i. ident == keywords:: Invalid . ident ( ) => {
150145 return visit:: walk_item ( self , i) ;
151146 }
147+ ItemKind :: Mod ( ..) | ItemKind :: Trait ( ..) | ItemKind :: TraitAlias ( ..) |
148+ ItemKind :: Enum ( ..) | ItemKind :: Struct ( ..) | ItemKind :: Union ( ..) |
149+ ItemKind :: Existential ( ..) | ItemKind :: ExternCrate ( ..) | ItemKind :: ForeignMod ( ..) |
150+ ItemKind :: Ty ( ..) => DefPathData :: TypeNs ( i. ident . as_interned_str ( ) ) ,
152151 ItemKind :: Fn (
153152 ref decl,
154153 ref header,
@@ -165,10 +164,9 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
165164 body,
166165 )
167166 }
168- ItemKind :: Mod ( ..) => DefPathData :: Module ( i. ident . as_interned_str ( ) ) ,
169167 ItemKind :: Static ( ..) | ItemKind :: Const ( ..) | ItemKind :: Fn ( ..) =>
170168 DefPathData :: ValueNs ( i. ident . as_interned_str ( ) ) ,
171- ItemKind :: MacroDef ( ..) => DefPathData :: MacroDef ( i. ident . as_interned_str ( ) ) ,
169+ ItemKind :: MacroDef ( ..) => DefPathData :: MacroNs ( i. ident . as_interned_str ( ) ) ,
172170 ItemKind :: Mac ( ..) => return self . visit_macro_invoc ( i. id ) ,
173171 ItemKind :: GlobalAsm ( ..) => DefPathData :: Misc ,
174172 ItemKind :: Use ( ..) => {
@@ -213,7 +211,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
213211
214212 fn visit_variant ( & mut self , v : & ' a Variant , g : & ' a Generics , item_id : NodeId ) {
215213 let def = self . create_def ( v. node . id ,
216- DefPathData :: EnumVariant ( v. node . ident . as_interned_str ( ) ) ,
214+ DefPathData :: TypeNs ( v. node . ident . as_interned_str ( ) ) ,
217215 REGULAR_SPACE ,
218216 v. span ) ;
219217 self . with_parent ( def, |this| {
@@ -230,7 +228,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
230228 let name = field. ident . map ( |ident| ident. name )
231229 . unwrap_or_else ( || Symbol :: intern ( & index. to_string ( ) ) ) ;
232230 let def = self . create_def ( field. id ,
233- DefPathData :: Field ( name. as_interned_str ( ) ) ,
231+ DefPathData :: ValueNs ( name. as_interned_str ( ) ) ,
234232 REGULAR_SPACE ,
235233 field. span ) ;
236234 self . with_parent ( def, |this| this. visit_struct_field ( field) ) ;
@@ -240,9 +238,9 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
240238 fn visit_generic_param ( & mut self , param : & ' a GenericParam ) {
241239 let name = param. ident . as_interned_str ( ) ;
242240 let def_path_data = match param. kind {
243- GenericParamKind :: Lifetime { .. } => DefPathData :: LifetimeParam ( name) ,
244- GenericParamKind :: Type { .. } => DefPathData :: TypeParam ( name) ,
245- GenericParamKind :: Const { .. } => DefPathData :: ConstParam ( name) ,
241+ GenericParamKind :: Lifetime { .. } => DefPathData :: LifetimeNs ( name) ,
242+ GenericParamKind :: Type { .. } => DefPathData :: TypeNs ( name) ,
243+ GenericParamKind :: Const { .. } => DefPathData :: ValueNs ( name) ,
246244 } ;
247245 self . create_def ( param. id , def_path_data, REGULAR_SPACE , param. ident . span ) ;
248246
@@ -254,7 +252,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
254252 TraitItemKind :: Method ( ..) | TraitItemKind :: Const ( ..) =>
255253 DefPathData :: ValueNs ( ti. ident . as_interned_str ( ) ) ,
256254 TraitItemKind :: Type ( ..) => {
257- DefPathData :: AssocTypeInTrait ( ti. ident . as_interned_str ( ) )
255+ DefPathData :: TypeNs ( ti. ident . as_interned_str ( ) )
258256 } ,
259257 TraitItemKind :: Macro ( ..) => return self . visit_macro_invoc ( ti. id ) ,
260258 } ;
@@ -281,9 +279,9 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
281279 }
282280 ImplItemKind :: Method ( ..) | ImplItemKind :: Const ( ..) =>
283281 DefPathData :: ValueNs ( ii. ident . as_interned_str ( ) ) ,
284- ImplItemKind :: Type ( ..) => DefPathData :: AssocTypeInImpl ( ii . ident . as_interned_str ( ) ) ,
282+ ImplItemKind :: Type ( ..) |
285283 ImplItemKind :: Existential ( ..) => {
286- DefPathData :: AssocExistentialInImpl ( ii. ident . as_interned_str ( ) )
284+ DefPathData :: TypeNs ( ii. ident . as_interned_str ( ) )
287285 } ,
288286 ImplItemKind :: Macro ( ..) => return self . visit_macro_invoc ( ii. id ) ,
289287 } ;
0 commit comments