@@ -2562,22 +2562,25 @@ pub enum ItemKind<'hir> {
25622562 TraitAlias ( Generics < ' hir > , GenericBounds < ' hir > ) ,
25632563
25642564 /// An implementation, e.g., `impl<A> Trait for Foo { .. }`.
2565- Impl {
2566- unsafety : Unsafety ,
2567- polarity : ImplPolarity ,
2568- defaultness : Defaultness ,
2569- // We do not put a `Span` in `Defaultness` because it breaks foreign crate metadata
2570- // decoding as `Span`s cannot be decoded when a `Session` is not available.
2571- defaultness_span : Option < Span > ,
2572- constness : Constness ,
2573- generics : Generics < ' hir > ,
2574-
2575- /// The trait being implemented, if any.
2576- of_trait : Option < TraitRef < ' hir > > ,
2577-
2578- self_ty : & ' hir Ty < ' hir > ,
2579- items : & ' hir [ ImplItemRef < ' hir > ] ,
2580- } ,
2565+ Impl ( Impl < ' hir > ) ,
2566+ }
2567+
2568+ #[ derive( Debug , HashStable_Generic ) ]
2569+ pub struct Impl < ' hir > {
2570+ pub unsafety : Unsafety ,
2571+ pub polarity : ImplPolarity ,
2572+ pub defaultness : Defaultness ,
2573+ // We do not put a `Span` in `Defaultness` because it breaks foreign crate metadata
2574+ // decoding as `Span`s cannot be decoded when a `Session` is not available.
2575+ pub defaultness_span : Option < Span > ,
2576+ pub constness : Constness ,
2577+ pub generics : Generics < ' hir > ,
2578+
2579+ /// The trait being implemented, if any.
2580+ pub of_trait : Option < TraitRef < ' hir > > ,
2581+
2582+ pub self_ty : & ' hir Ty < ' hir > ,
2583+ pub items : & ' hir [ ImplItemRef < ' hir > ] ,
25812584}
25822585
25832586impl ItemKind < ' _ > {
@@ -2590,7 +2593,7 @@ impl ItemKind<'_> {
25902593 | ItemKind :: Struct ( _, ref generics)
25912594 | ItemKind :: Union ( _, ref generics)
25922595 | ItemKind :: Trait ( _, _, ref generics, _, _)
2593- | ItemKind :: Impl { ref generics, .. } => generics,
2596+ | ItemKind :: Impl ( Impl { ref generics, .. } ) => generics,
25942597 _ => return None ,
25952598 } )
25962599 }
0 commit comments