@@ -664,16 +664,16 @@ pub enum ImplSource<'tcx, N> {
664
664
/// ImplSource automatically generated for a closure. The `DefId` is the ID
665
665
/// of the closure expression. This is an `ImplSource::UserDefined` in spirit, but the
666
666
/// impl is generated by the compiler and does not appear in the source.
667
- Closure ( ImplSourceClosureData < ' tcx , N > ) ,
667
+ Closure ( Vec < N > ) ,
668
668
669
669
/// Same as above, but for a function pointer type with the given signature.
670
- FnPointer ( ImplSourceFnPointerData < ' tcx , N > ) ,
670
+ FnPointer ( Vec < N > ) ,
671
671
672
672
/// ImplSource automatically generated for a generator.
673
- Generator ( ImplSourceGeneratorData < ' tcx , N > ) ,
673
+ Generator ( Vec < N > ) ,
674
674
675
675
/// ImplSource automatically generated for a generator backing an async future.
676
- Future ( ImplSourceFutureData < ' tcx , N > ) ,
676
+ Future ( Vec < N > ) ,
677
677
678
678
/// ImplSource for a trait alias.
679
679
TraitAlias ( ImplSourceTraitAliasData < ' tcx , N > ) ,
@@ -683,12 +683,13 @@ impl<'tcx, N> ImplSource<'tcx, N> {
683
683
pub fn nested_obligations ( self ) -> Vec < N > {
684
684
match self {
685
685
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,
690
692
ImplSource :: Object ( d) => d. nested ,
691
- ImplSource :: FnPointer ( d) => d. nested ,
692
693
ImplSource :: TraitAlias ( d) => d. nested ,
693
694
ImplSource :: TraitUpcasting ( d) => d. nested ,
694
695
}
@@ -697,12 +698,13 @@ impl<'tcx, N> ImplSource<'tcx, N> {
697
698
pub fn borrow_nested_obligations ( & self ) -> & [ N ] {
698
699
match self {
699
700
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,
704
707
ImplSource :: Object ( d) => & d. nested ,
705
- ImplSource :: FnPointer ( d) => & d. nested ,
706
708
ImplSource :: TraitAlias ( d) => & d. nested ,
707
709
ImplSource :: TraitUpcasting ( d) => & d. nested ,
708
710
}
@@ -711,12 +713,13 @@ impl<'tcx, N> ImplSource<'tcx, N> {
711
713
pub fn borrow_nested_obligations_mut ( & mut self ) -> & mut [ N ] {
712
714
match self {
713
715
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,
718
722
ImplSource :: Object ( d) => & mut d. nested ,
719
- ImplSource :: FnPointer ( d) => & mut d. nested ,
720
723
ImplSource :: TraitAlias ( d) => & mut d. nested ,
721
724
ImplSource :: TraitUpcasting ( d) => & mut d. nested ,
722
725
}
@@ -739,25 +742,10 @@ impl<'tcx, N> ImplSource<'tcx, N> {
739
742
vtable_base : o. vtable_base ,
740
743
nested : o. nested . into_iter ( ) . map ( f) . collect ( ) ,
741
744
} ) ,
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 ( ) ) ,
761
749
ImplSource :: TraitAlias ( d) => ImplSource :: TraitAlias ( ImplSourceTraitAliasData {
762
750
alias_def_id : d. alias_def_id ,
763
751
substs : d. substs ,
@@ -791,36 +779,6 @@ pub struct ImplSourceUserDefinedData<'tcx, N> {
791
779
pub nested : Vec < N > ,
792
780
}
793
781
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
-
824
782
#[ derive( Clone , PartialEq , Eq , TyEncodable , TyDecodable , HashStable , Lift ) ]
825
783
#[ derive( TypeFoldable , TypeVisitable ) ]
826
784
pub struct ImplSourceTraitUpcastingData < N > {
@@ -848,13 +806,6 @@ pub struct ImplSourceObjectData<N> {
848
806
pub nested : Vec < N > ,
849
807
}
850
808
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
-
858
809
#[ derive( Clone , PartialEq , Eq , TyEncodable , TyDecodable , HashStable , Lift ) ]
859
810
#[ derive( TypeFoldable , TypeVisitable ) ]
860
811
pub struct ImplSourceTraitAliasData < ' tcx , N > {
0 commit comments