@@ -2751,7 +2751,7 @@ pub struct BareFnTy<'hir> {
27512751pub struct OpaqueTy < ' hir > {
27522752 pub generics : & ' hir Generics < ' hir > ,
27532753 pub bounds : GenericBounds < ' hir > ,
2754- pub origin : OpaqueTyOrigin ,
2754+ pub origin : OpaqueTyOrigin < LocalDefId > ,
27552755 /// Return-position impl traits (and async futures) must "reify" any late-bound
27562756 /// lifetimes that are captured from the function signature they originate from.
27572757 ///
@@ -2798,33 +2798,35 @@ pub struct PreciseCapturingNonLifetimeArg {
27982798 pub res : Res ,
27992799}
28002800
2801- #[ derive( Copy , Clone , PartialEq , Eq , Debug , HashStable_Generic ) ]
2801+ #[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
2802+ #[ derive( HashStable_Generic , Encodable , Decodable ) ]
28022803pub enum RpitContext {
28032804 Trait ,
28042805 TraitImpl ,
28052806}
28062807
28072808/// From whence the opaque type came.
2808- #[ derive( Copy , Clone , PartialEq , Eq , Debug , HashStable_Generic ) ]
2809- pub enum OpaqueTyOrigin {
2809+ #[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
2810+ #[ derive( HashStable_Generic , Encodable , Decodable ) ]
2811+ pub enum OpaqueTyOrigin < D > {
28102812 /// `-> impl Trait`
28112813 FnReturn {
28122814 /// The defining function.
2813- parent : LocalDefId ,
2815+ parent : D ,
28142816 // Whether this is an RPITIT (return position impl trait in trait)
28152817 in_trait_or_impl : Option < RpitContext > ,
28162818 } ,
28172819 /// `async fn`
28182820 AsyncFn {
28192821 /// The defining function.
2820- parent : LocalDefId ,
2822+ parent : D ,
28212823 // Whether this is an AFIT (async fn in trait)
28222824 in_trait_or_impl : Option < RpitContext > ,
28232825 } ,
28242826 /// type aliases: `type Foo = impl Trait;`
28252827 TyAlias {
28262828 /// The type alias or associated type parent of the TAIT/ATPIT
2827- parent : LocalDefId ,
2829+ parent : D ,
28282830 /// associated types in impl blocks for traits.
28292831 in_assoc_ty : bool ,
28302832 } ,
0 commit comments