@@ -313,12 +313,12 @@ pub enum Res<Id = hir::HirId> {
313313 /// which already works on stable while causing the `const_evaluatable_unchecked` future compat lint.
314314 ///
315315 /// FIXME(generic_const_exprs): Remove this bodge once that feature is stable.
316- SelfTy (
316+ SelfTy {
317317 /// 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+ } ,
322322 /// A tool attribute module; e.g., the `rustfmt` in `#[rustfmt::skip]`.
323323 ///
324324 /// **Belongs to the type namespace.**
@@ -550,7 +550,7 @@ impl<Id> Res<Id> {
550550
551551 Res :: Local ( ..)
552552 | Res :: PrimTy ( ..)
553- | Res :: SelfTy ( .. )
553+ | Res :: SelfTy { .. }
554554 | Res :: SelfCtor ( ..)
555555 | Res :: ToolMod
556556 | Res :: NonMacroAttr ( ..)
@@ -573,7 +573,7 @@ impl<Id> Res<Id> {
573573 Res :: SelfCtor ( ..) => "self constructor" ,
574574 Res :: PrimTy ( ..) => "builtin type" ,
575575 Res :: Local ( ..) => "local variable" ,
576- Res :: SelfTy ( .. ) => "self type" ,
576+ Res :: SelfTy { .. } => "self type" ,
577577 Res :: ToolMod => "tool module" ,
578578 Res :: NonMacroAttr ( attr_kind) => attr_kind. descr ( ) ,
579579 Res :: Err => "unresolved item" ,
@@ -596,7 +596,7 @@ impl<Id> Res<Id> {
596596 Res :: SelfCtor ( id) => Res :: SelfCtor ( id) ,
597597 Res :: PrimTy ( id) => Res :: PrimTy ( id) ,
598598 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 } ,
600600 Res :: ToolMod => Res :: ToolMod ,
601601 Res :: NonMacroAttr ( attr_kind) => Res :: NonMacroAttr ( attr_kind) ,
602602 Res :: Err => Res :: Err ,
@@ -620,7 +620,7 @@ impl<Id> Res<Id> {
620620 pub fn ns ( & self ) -> Option < Namespace > {
621621 match self {
622622 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 ) ,
624624 Res :: SelfCtor ( ..) | Res :: Local ( ..) => Some ( Namespace :: ValueNS ) ,
625625 Res :: NonMacroAttr ( ..) => Some ( Namespace :: MacroNS ) ,
626626 Res :: Err => None ,
0 commit comments