@@ -664,16 +664,16 @@ pub enum ImplSource<'tcx, N> {
664664 /// ImplSource automatically generated for a closure. The `DefId` is the ID
665665 /// of the closure expression. This is an `ImplSource::UserDefined` in spirit, but the
666666 /// impl is generated by the compiler and does not appear in the source.
667- Closure ( ImplSourceClosureData < ' tcx , N > ) ,
667+ Closure ( Vec < N > ) ,
668668
669669 /// Same as above, but for a function pointer type with the given signature.
670- FnPointer ( ImplSourceFnPointerData < ' tcx , N > ) ,
670+ FnPointer ( Vec < N > ) ,
671671
672672 /// ImplSource automatically generated for a generator.
673- Generator ( ImplSourceGeneratorData < ' tcx , N > ) ,
673+ Generator ( Vec < N > ) ,
674674
675675 /// ImplSource automatically generated for a generator backing an async future.
676- Future ( ImplSourceFutureData < ' tcx , N > ) ,
676+ Future ( Vec < N > ) ,
677677
678678 /// ImplSource for a trait alias.
679679 TraitAlias ( ImplSourceTraitAliasData < ' tcx , N > ) ,
@@ -683,12 +683,13 @@ impl<'tcx, N> ImplSource<'tcx, N> {
683683 pub fn nested_obligations ( self ) -> Vec < N > {
684684 match self {
685685 ImplSource :: UserDefined ( i) => i. nested ,
686- ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) => n,
687- ImplSource :: Closure ( c) => c. nested ,
688- ImplSource :: Generator ( c) => c. nested ,
689- ImplSource :: Future ( c) => c. nested ,
686+ ImplSource :: Param ( n, _)
687+ | ImplSource :: Builtin ( n)
688+ | ImplSource :: FnPointer ( n)
689+ | ImplSource :: Closure ( n)
690+ | ImplSource :: Generator ( n)
691+ | ImplSource :: Future ( n) => n,
690692 ImplSource :: Object ( d) => d. nested ,
691- ImplSource :: FnPointer ( d) => d. nested ,
692693 ImplSource :: TraitAlias ( d) => d. nested ,
693694 ImplSource :: TraitUpcasting ( d) => d. nested ,
694695 }
@@ -697,12 +698,13 @@ impl<'tcx, N> ImplSource<'tcx, N> {
697698 pub fn borrow_nested_obligations ( & self ) -> & [ N ] {
698699 match self {
699700 ImplSource :: UserDefined ( i) => & i. nested ,
700- ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) => n,
701- ImplSource :: Closure ( c) => & c. nested ,
702- ImplSource :: Generator ( c) => & c. nested ,
703- ImplSource :: Future ( c) => & c. nested ,
701+ ImplSource :: Param ( n, _)
702+ | ImplSource :: Builtin ( n)
703+ | ImplSource :: FnPointer ( n)
704+ | ImplSource :: Closure ( n)
705+ | ImplSource :: Generator ( n)
706+ | ImplSource :: Future ( n) => & n,
704707 ImplSource :: Object ( d) => & d. nested ,
705- ImplSource :: FnPointer ( d) => & d. nested ,
706708 ImplSource :: TraitAlias ( d) => & d. nested ,
707709 ImplSource :: TraitUpcasting ( d) => & d. nested ,
708710 }
@@ -711,12 +713,13 @@ impl<'tcx, N> ImplSource<'tcx, N> {
711713 pub fn borrow_nested_obligations_mut ( & mut self ) -> & mut [ N ] {
712714 match self {
713715 ImplSource :: UserDefined ( i) => & mut i. nested ,
714- ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) => n,
715- ImplSource :: Closure ( c) => & mut c. nested ,
716- ImplSource :: Generator ( c) => & mut c. nested ,
717- ImplSource :: Future ( c) => & mut c. nested ,
716+ ImplSource :: Param ( n, _)
717+ | ImplSource :: Builtin ( n)
718+ | ImplSource :: FnPointer ( n)
719+ | ImplSource :: Closure ( n)
720+ | ImplSource :: Generator ( n)
721+ | ImplSource :: Future ( n) => n,
718722 ImplSource :: Object ( d) => & mut d. nested ,
719- ImplSource :: FnPointer ( d) => & mut d. nested ,
720723 ImplSource :: TraitAlias ( d) => & mut d. nested ,
721724 ImplSource :: TraitUpcasting ( d) => & mut d. nested ,
722725 }
@@ -739,25 +742,10 @@ impl<'tcx, N> ImplSource<'tcx, N> {
739742 vtable_base : o. vtable_base ,
740743 nested : o. nested . into_iter ( ) . map ( f) . collect ( ) ,
741744 } ) ,
742- ImplSource :: Closure ( c) => ImplSource :: Closure ( ImplSourceClosureData {
743- closure_def_id : c. closure_def_id ,
744- substs : c. substs ,
745- nested : c. nested . into_iter ( ) . map ( f) . collect ( ) ,
746- } ) ,
747- ImplSource :: Generator ( c) => ImplSource :: Generator ( ImplSourceGeneratorData {
748- generator_def_id : c. generator_def_id ,
749- substs : c. substs ,
750- nested : c. nested . into_iter ( ) . map ( f) . collect ( ) ,
751- } ) ,
752- ImplSource :: Future ( c) => ImplSource :: Future ( ImplSourceFutureData {
753- generator_def_id : c. generator_def_id ,
754- substs : c. substs ,
755- nested : c. nested . into_iter ( ) . map ( f) . collect ( ) ,
756- } ) ,
757- ImplSource :: FnPointer ( p) => ImplSource :: FnPointer ( ImplSourceFnPointerData {
758- fn_ty : p. fn_ty ,
759- nested : p. nested . into_iter ( ) . map ( f) . collect ( ) ,
760- } ) ,
745+ ImplSource :: Closure ( n) => ImplSource :: Closure ( n. into_iter ( ) . map ( f) . collect ( ) ) ,
746+ ImplSource :: Generator ( n) => ImplSource :: Generator ( n. into_iter ( ) . map ( f) . collect ( ) ) ,
747+ ImplSource :: Future ( n) => ImplSource :: Future ( n. into_iter ( ) . map ( f) . collect ( ) ) ,
748+ ImplSource :: FnPointer ( n) => ImplSource :: FnPointer ( n. into_iter ( ) . map ( f) . collect ( ) ) ,
761749 ImplSource :: TraitAlias ( d) => ImplSource :: TraitAlias ( ImplSourceTraitAliasData {
762750 alias_def_id : d. alias_def_id ,
763751 substs : d. substs ,
@@ -791,36 +779,6 @@ pub struct ImplSourceUserDefinedData<'tcx, N> {
791779 pub nested : Vec < N > ,
792780}
793781
794- #[ derive( Clone , PartialEq , Eq , TyEncodable , TyDecodable , HashStable , Lift ) ]
795- #[ derive( TypeFoldable , TypeVisitable ) ]
796- pub struct ImplSourceGeneratorData < ' tcx , N > {
797- pub generator_def_id : DefId ,
798- pub substs : SubstsRef < ' tcx > ,
799- /// Nested obligations. This can be non-empty if the generator
800- /// signature contains associated types.
801- pub nested : Vec < N > ,
802- }
803-
804- #[ derive( Clone , PartialEq , Eq , TyEncodable , TyDecodable , HashStable , Lift ) ]
805- #[ derive( TypeFoldable , TypeVisitable ) ]
806- pub struct ImplSourceFutureData < ' tcx , N > {
807- pub generator_def_id : DefId ,
808- pub substs : SubstsRef < ' tcx > ,
809- /// Nested obligations. This can be non-empty if the generator
810- /// signature contains associated types.
811- pub nested : Vec < N > ,
812- }
813-
814- #[ derive( Clone , PartialEq , Eq , TyEncodable , TyDecodable , HashStable , Lift ) ]
815- #[ derive( TypeFoldable , TypeVisitable ) ]
816- pub struct ImplSourceClosureData < ' tcx , N > {
817- pub closure_def_id : DefId ,
818- pub substs : SubstsRef < ' tcx > ,
819- /// Nested obligations. This can be non-empty if the closure
820- /// signature contains associated types.
821- pub nested : Vec < N > ,
822- }
823-
824782#[ derive( Clone , PartialEq , Eq , TyEncodable , TyDecodable , HashStable , Lift ) ]
825783#[ derive( TypeFoldable , TypeVisitable ) ]
826784pub struct ImplSourceTraitUpcastingData < N > {
@@ -848,13 +806,6 @@ pub struct ImplSourceObjectData<N> {
848806 pub nested : Vec < N > ,
849807}
850808
851- #[ derive( Clone , PartialEq , Eq , TyEncodable , TyDecodable , HashStable , Lift ) ]
852- #[ derive( TypeFoldable , TypeVisitable ) ]
853- pub struct ImplSourceFnPointerData < ' tcx , N > {
854- pub fn_ty : Ty < ' tcx > ,
855- pub nested : Vec < N > ,
856- }
857-
858809#[ derive( Clone , PartialEq , Eq , TyEncodable , TyDecodable , HashStable , Lift ) ]
859810#[ derive( TypeFoldable , TypeVisitable ) ]
860811pub struct ImplSourceTraitAliasData < ' tcx , N > {
0 commit comments