@@ -313,12 +313,12 @@ pub enum Res<Id = hir::HirId> {
313
313
/// which already works on stable while causing the `const_evaluatable_unchecked` future compat lint.
314
314
///
315
315
/// FIXME(generic_const_exprs): Remove this bodge once that feature is stable.
316
- SelfTy (
316
+ SelfTy {
317
317
/// Optionally, the trait associated with this `Self` type.
318
- Option < DefId > ,
319
- /// Optionally, the impl associated with this `Self` type.
320
- Option < ( DefId , bool ) > ,
321
- ) ,
318
+ trait_ : Option < DefId > ,
319
+ /// Optionally, the impl or adt associated with this `Self` type.
320
+ alias_to : Option < ( DefId , bool ) > ,
321
+ } ,
322
322
/// A tool attribute module; e.g., the `rustfmt` in `#[rustfmt::skip]`.
323
323
///
324
324
/// **Belongs to the type namespace.**
@@ -550,7 +550,7 @@ impl<Id> Res<Id> {
550
550
551
551
Res :: Local ( ..)
552
552
| Res :: PrimTy ( ..)
553
- | Res :: SelfTy ( .. )
553
+ | Res :: SelfTy { .. }
554
554
| Res :: SelfCtor ( ..)
555
555
| Res :: ToolMod
556
556
| Res :: NonMacroAttr ( ..)
@@ -573,7 +573,7 @@ impl<Id> Res<Id> {
573
573
Res :: SelfCtor ( ..) => "self constructor" ,
574
574
Res :: PrimTy ( ..) => "builtin type" ,
575
575
Res :: Local ( ..) => "local variable" ,
576
- Res :: SelfTy ( .. ) => "self type" ,
576
+ Res :: SelfTy { .. } => "self type" ,
577
577
Res :: ToolMod => "tool module" ,
578
578
Res :: NonMacroAttr ( attr_kind) => attr_kind. descr ( ) ,
579
579
Res :: Err => "unresolved item" ,
@@ -596,7 +596,7 @@ impl<Id> Res<Id> {
596
596
Res :: SelfCtor ( id) => Res :: SelfCtor ( id) ,
597
597
Res :: PrimTy ( id) => Res :: PrimTy ( id) ,
598
598
Res :: Local ( id) => Res :: Local ( map ( id) ) ,
599
- Res :: SelfTy ( a , b ) => Res :: SelfTy ( a , b ) ,
599
+ Res :: SelfTy { trait_ , alias_to } => Res :: SelfTy { trait_ , alias_to } ,
600
600
Res :: ToolMod => Res :: ToolMod ,
601
601
Res :: NonMacroAttr ( attr_kind) => Res :: NonMacroAttr ( attr_kind) ,
602
602
Res :: Err => Res :: Err ,
@@ -620,7 +620,7 @@ impl<Id> Res<Id> {
620
620
pub fn ns ( & self ) -> Option < Namespace > {
621
621
match self {
622
622
Res :: Def ( kind, ..) => kind. ns ( ) ,
623
- Res :: PrimTy ( ..) | Res :: SelfTy ( .. ) | Res :: ToolMod => Some ( Namespace :: TypeNS ) ,
623
+ Res :: PrimTy ( ..) | Res :: SelfTy { .. } | Res :: ToolMod => Some ( Namespace :: TypeNS ) ,
624
624
Res :: SelfCtor ( ..) | Res :: Local ( ..) => Some ( Namespace :: ValueNS ) ,
625
625
Res :: NonMacroAttr ( ..) => Some ( Namespace :: MacroNS ) ,
626
626
Res :: Err => None ,
0 commit comments