@@ -2562,22 +2562,25 @@ pub enum ItemKind<'hir> {
2562
2562
TraitAlias ( Generics < ' hir > , GenericBounds < ' hir > ) ,
2563
2563
2564
2564
/// 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 > ] ,
2581
2584
}
2582
2585
2583
2586
impl ItemKind < ' _ > {
@@ -2590,7 +2593,7 @@ impl ItemKind<'_> {
2590
2593
| ItemKind :: Struct ( _, ref generics)
2591
2594
| ItemKind :: Union ( _, ref generics)
2592
2595
| ItemKind :: Trait ( _, _, ref generics, _, _)
2593
- | ItemKind :: Impl { ref generics, .. } => generics,
2596
+ | ItemKind :: Impl ( Impl { ref generics, .. } ) => generics,
2594
2597
_ => return None ,
2595
2598
} )
2596
2599
}
0 commit comments