@@ -271,9 +271,8 @@ pub enum DefPathData {
271271 Use ,
272272 /// A global asm item.
273273 GlobalAsm ,
274- /// Something in the type namespace. Will be empty for RPITIT associated
275- /// types, which are given a synthetic name later, if necessary.
276- TypeNs ( Option < Symbol > ) ,
274+ /// Something in the type namespace.
275+ TypeNs ( Symbol ) ,
277276 /// Something in the value namespace.
278277 ValueNs ( Symbol ) ,
279278 /// Something in the macro namespace.
@@ -291,6 +290,8 @@ pub enum DefPathData {
291290 /// An existential `impl Trait` type node.
292291 /// Argument position `impl Trait` have a `TypeNs` with their pretty-printed name.
293292 OpaqueTy ,
293+ /// An anonymous associated type from an RPITIT.
294+ AnonAssocTy ,
294295 /// A synthetic body for a coroutine's by-move body.
295296 SyntheticCoroutineBody ,
296297}
@@ -413,9 +414,7 @@ impl DefPathData {
413414 pub fn get_opt_name ( & self ) -> Option < Symbol > {
414415 use self :: DefPathData :: * ;
415416 match * self {
416- TypeNs ( name) => name,
417-
418- ValueNs ( name) | MacroNs ( name) | LifetimeNs ( name) => Some ( name) ,
417+ TypeNs ( name) | ValueNs ( name) | MacroNs ( name) | LifetimeNs ( name) => Some ( name) ,
419418
420419 Impl
421420 | ForeignMod
@@ -426,21 +425,17 @@ impl DefPathData {
426425 | Ctor
427426 | AnonConst
428427 | OpaqueTy
428+ | AnonAssocTy
429429 | SyntheticCoroutineBody => None ,
430430 }
431431 }
432432
433433 pub fn name ( & self ) -> DefPathDataName {
434434 use self :: DefPathData :: * ;
435435 match * self {
436- TypeNs ( name) => {
437- if let Some ( name) = name {
438- DefPathDataName :: Named ( name)
439- } else {
440- DefPathDataName :: Anon { namespace : sym:: synthetic }
441- }
436+ TypeNs ( name) | ValueNs ( name) | MacroNs ( name) | LifetimeNs ( name) => {
437+ DefPathDataName :: Named ( name)
442438 }
443- ValueNs ( name) | MacroNs ( name) | LifetimeNs ( name) => DefPathDataName :: Named ( name) ,
444439 // Note that this does not show up in user print-outs.
445440 CrateRoot => DefPathDataName :: Anon { namespace : kw:: Crate } ,
446441 Impl => DefPathDataName :: Anon { namespace : kw:: Impl } ,
@@ -451,6 +446,7 @@ impl DefPathData {
451446 Ctor => DefPathDataName :: Anon { namespace : sym:: constructor } ,
452447 AnonConst => DefPathDataName :: Anon { namespace : sym:: constant } ,
453448 OpaqueTy => DefPathDataName :: Anon { namespace : sym:: opaque } ,
449+ AnonAssocTy => DefPathDataName :: Anon { namespace : sym:: anon_assoc } ,
454450 SyntheticCoroutineBody => DefPathDataName :: Anon { namespace : sym:: synthetic } ,
455451 }
456452 }
0 commit comments