@@ -271,9 +271,8 @@ pub enum DefPathData {
271
271
Use ,
272
272
/// A global asm item.
273
273
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 ) ,
277
276
/// Something in the value namespace.
278
277
ValueNs ( Symbol ) ,
279
278
/// Something in the macro namespace.
@@ -291,6 +290,8 @@ pub enum DefPathData {
291
290
/// An existential `impl Trait` type node.
292
291
/// Argument position `impl Trait` have a `TypeNs` with their pretty-printed name.
293
292
OpaqueTy ,
293
+ /// An anonymous associated type from an RPITIT.
294
+ AnonAssocTy ,
294
295
/// A synthetic body for a coroutine's by-move body.
295
296
SyntheticCoroutineBody ,
296
297
}
@@ -413,9 +414,7 @@ impl DefPathData {
413
414
pub fn get_opt_name ( & self ) -> Option < Symbol > {
414
415
use self :: DefPathData :: * ;
415
416
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) ,
419
418
420
419
Impl
421
420
| ForeignMod
@@ -426,21 +425,17 @@ impl DefPathData {
426
425
| Ctor
427
426
| AnonConst
428
427
| OpaqueTy
428
+ | AnonAssocTy
429
429
| SyntheticCoroutineBody => None ,
430
430
}
431
431
}
432
432
433
433
pub fn name ( & self ) -> DefPathDataName {
434
434
use self :: DefPathData :: * ;
435
435
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)
442
438
}
443
- ValueNs ( name) | MacroNs ( name) | LifetimeNs ( name) => DefPathDataName :: Named ( name) ,
444
439
// Note that this does not show up in user print-outs.
445
440
CrateRoot => DefPathDataName :: Anon { namespace : kw:: Crate } ,
446
441
Impl => DefPathDataName :: Anon { namespace : kw:: Impl } ,
@@ -451,6 +446,7 @@ impl DefPathData {
451
446
Ctor => DefPathDataName :: Anon { namespace : sym:: constructor } ,
452
447
AnonConst => DefPathDataName :: Anon { namespace : sym:: constant } ,
453
448
OpaqueTy => DefPathDataName :: Anon { namespace : sym:: opaque } ,
449
+ AnonAssocTy => DefPathDataName :: Anon { namespace : sym:: anon_assoc } ,
454
450
SyntheticCoroutineBody => DefPathDataName :: Anon { namespace : sym:: synthetic } ,
455
451
}
456
452
}
0 commit comments