@@ -2752,7 +2752,7 @@ pub struct OpaqueTy<'hir> {
27522752 pub def_id : LocalDefId ,
27532753 pub generics : & ' hir Generics < ' hir > ,
27542754 pub bounds : GenericBounds < ' hir > ,
2755- pub origin : OpaqueTyOrigin ,
2755+ pub origin : OpaqueTyOrigin < LocalDefId > ,
27562756 /// Return-position impl traits (and async futures) must "reify" any late-bound
27572757 /// lifetimes that are captured from the function signature they originate from.
27582758 ///
@@ -2800,33 +2800,35 @@ pub struct PreciseCapturingNonLifetimeArg {
28002800 pub res : Res ,
28012801}
28022802
2803- #[ derive( Copy , Clone , PartialEq , Eq , Debug , HashStable_Generic ) ]
2803+ #[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
2804+ #[ derive( HashStable_Generic , Encodable , Decodable ) ]
28042805pub enum RpitContext {
28052806 Trait ,
28062807 TraitImpl ,
28072808}
28082809
28092810/// From whence the opaque type came.
2810- #[ derive( Copy , Clone , PartialEq , Eq , Debug , HashStable_Generic ) ]
2811- pub enum OpaqueTyOrigin {
2811+ #[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
2812+ #[ derive( HashStable_Generic , Encodable , Decodable ) ]
2813+ pub enum OpaqueTyOrigin < D > {
28122814 /// `-> impl Trait`
28132815 FnReturn {
28142816 /// The defining function.
2815- parent : LocalDefId ,
2817+ parent : D ,
28162818 // Whether this is an RPITIT (return position impl trait in trait)
28172819 in_trait_or_impl : Option < RpitContext > ,
28182820 } ,
28192821 /// `async fn`
28202822 AsyncFn {
28212823 /// The defining function.
2822- parent : LocalDefId ,
2824+ parent : D ,
28232825 // Whether this is an AFIT (async fn in trait)
28242826 in_trait_or_impl : Option < RpitContext > ,
28252827 } ,
28262828 /// type aliases: `type Foo = impl Trait;`
28272829 TyAlias {
28282830 /// The type alias or associated type parent of the TAIT/ATPIT
2829- parent : LocalDefId ,
2831+ parent : D ,
28302832 /// associated types in impl blocks for traits.
28312833 in_assoc_ty : bool ,
28322834 } ,
0 commit comments