@@ -2748,7 +2748,7 @@ pub struct OpaqueTy<'hir> {
27482748 pub def_id : LocalDefId ,
27492749 pub generics : & ' hir Generics < ' hir > ,
27502750 pub bounds : GenericBounds < ' hir > ,
2751- pub origin : OpaqueTyOrigin ,
2751+ pub origin : OpaqueTyOrigin < LocalDefId > ,
27522752 /// Return-position impl traits (and async futures) must "reify" any late-bound
27532753 /// lifetimes that are captured from the function signature they originate from.
27542754 ///
@@ -2796,33 +2796,35 @@ pub struct PreciseCapturingNonLifetimeArg {
27962796 pub res : Res ,
27972797}
27982798
2799- #[ derive( Copy , Clone , PartialEq , Eq , Debug , HashStable_Generic ) ]
2799+ #[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
2800+ #[ derive( HashStable_Generic , Encodable , Decodable ) ]
28002801pub enum RpitContext {
28012802 Trait ,
28022803 TraitImpl ,
28032804}
28042805
28052806/// From whence the opaque type came.
2806- #[ derive( Copy , Clone , PartialEq , Eq , Debug , HashStable_Generic ) ]
2807- pub enum OpaqueTyOrigin {
2807+ #[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
2808+ #[ derive( HashStable_Generic , Encodable , Decodable ) ]
2809+ pub enum OpaqueTyOrigin < D > {
28082810 /// `-> impl Trait`
28092811 FnReturn {
28102812 /// The defining function.
2811- parent : LocalDefId ,
2813+ parent : D ,
28122814 // Whether this is an RPITIT (return position impl trait in trait)
28132815 in_trait_or_impl : Option < RpitContext > ,
28142816 } ,
28152817 /// `async fn`
28162818 AsyncFn {
28172819 /// The defining function.
2818- parent : LocalDefId ,
2820+ parent : D ,
28192821 // Whether this is an AFIT (async fn in trait)
28202822 in_trait_or_impl : Option < RpitContext > ,
28212823 } ,
28222824 /// type aliases: `type Foo = impl Trait;`
28232825 TyAlias {
28242826 /// The type alias or associated type parent of the TAIT/ATPIT
2825- parent : LocalDefId ,
2827+ parent : D ,
28262828 /// associated types in impl blocks for traits.
28272829 in_assoc_ty : bool ,
28282830 } ,
0 commit comments