@@ -646,12 +646,6 @@ pub enum ImplSource<'tcx, N> {
646
646
/// ImplSource identifying a particular impl.
647
647
UserDefined ( ImplSourceUserDefinedData < ' tcx , N > ) ,
648
648
649
- /// ImplSource for auto trait implementations.
650
- /// This carries the information and nested obligations with regards
651
- /// to an auto implementation for a trait `Trait`. The nested obligations
652
- /// ensure the trait implementation holds for all the constituent types.
653
- AutoImpl ( ImplSourceAutoImplData < N > ) ,
654
-
655
649
/// Successful resolution to an obligation provided by the caller
656
650
/// for some type parameter. The `Vec<N>` represents the
657
651
/// obligations incurred from normalizing the where-clause (if
@@ -683,57 +677,48 @@ pub enum ImplSource<'tcx, N> {
683
677
684
678
/// ImplSource for a trait alias.
685
679
TraitAlias ( ImplSourceTraitAliasData < ' tcx , N > ) ,
686
-
687
- /// ImplSource for a `const Drop` implementation.
688
- ConstDestruct ( ImplSourceConstDestructData < N > ) ,
689
680
}
690
681
691
682
impl < ' tcx , N > ImplSource < ' tcx , N > {
692
683
pub fn nested_obligations ( self ) -> Vec < N > {
693
684
match self {
694
685
ImplSource :: UserDefined ( i) => i. nested ,
695
686
ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) => n,
696
- ImplSource :: AutoImpl ( d) => d. nested ,
697
687
ImplSource :: Closure ( c) => c. nested ,
698
688
ImplSource :: Generator ( c) => c. nested ,
699
689
ImplSource :: Future ( c) => c. nested ,
700
690
ImplSource :: Object ( d) => d. nested ,
701
691
ImplSource :: FnPointer ( d) => d. nested ,
702
692
ImplSource :: TraitAlias ( d) => d. nested ,
703
693
ImplSource :: TraitUpcasting ( d) => d. nested ,
704
- ImplSource :: ConstDestruct ( i) => i. nested ,
705
694
}
706
695
}
707
696
708
697
pub fn borrow_nested_obligations ( & self ) -> & [ N ] {
709
698
match self {
710
699
ImplSource :: UserDefined ( i) => & i. nested ,
711
700
ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) => n,
712
- ImplSource :: AutoImpl ( d) => & d. nested ,
713
701
ImplSource :: Closure ( c) => & c. nested ,
714
702
ImplSource :: Generator ( c) => & c. nested ,
715
703
ImplSource :: Future ( c) => & c. nested ,
716
704
ImplSource :: Object ( d) => & d. nested ,
717
705
ImplSource :: FnPointer ( d) => & d. nested ,
718
706
ImplSource :: TraitAlias ( d) => & d. nested ,
719
707
ImplSource :: TraitUpcasting ( d) => & d. nested ,
720
- ImplSource :: ConstDestruct ( i) => & i. nested ,
721
708
}
722
709
}
723
710
724
711
pub fn borrow_nested_obligations_mut ( & mut self ) -> & mut [ N ] {
725
712
match self {
726
713
ImplSource :: UserDefined ( i) => & mut i. nested ,
727
714
ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) => n,
728
- ImplSource :: AutoImpl ( d) => & mut d. nested ,
729
715
ImplSource :: Closure ( c) => & mut c. nested ,
730
716
ImplSource :: Generator ( c) => & mut c. nested ,
731
717
ImplSource :: Future ( c) => & mut c. nested ,
732
718
ImplSource :: Object ( d) => & mut d. nested ,
733
719
ImplSource :: FnPointer ( d) => & mut d. nested ,
734
720
ImplSource :: TraitAlias ( d) => & mut d. nested ,
735
721
ImplSource :: TraitUpcasting ( d) => & mut d. nested ,
736
- ImplSource :: ConstDestruct ( i) => & mut i. nested ,
737
722
}
738
723
}
739
724
@@ -754,10 +739,6 @@ impl<'tcx, N> ImplSource<'tcx, N> {
754
739
vtable_base : o. vtable_base ,
755
740
nested : o. nested . into_iter ( ) . map ( f) . collect ( ) ,
756
741
} ) ,
757
- ImplSource :: AutoImpl ( d) => ImplSource :: AutoImpl ( ImplSourceAutoImplData {
758
- trait_def_id : d. trait_def_id ,
759
- nested : d. nested . into_iter ( ) . map ( f) . collect ( ) ,
760
- } ) ,
761
742
ImplSource :: Closure ( c) => ImplSource :: Closure ( ImplSourceClosureData {
762
743
closure_def_id : c. closure_def_id ,
763
744
substs : c. substs ,
@@ -788,11 +769,6 @@ impl<'tcx, N> ImplSource<'tcx, N> {
788
769
nested : d. nested . into_iter ( ) . map ( f) . collect ( ) ,
789
770
} )
790
771
}
791
- ImplSource :: ConstDestruct ( i) => {
792
- ImplSource :: ConstDestruct ( ImplSourceConstDestructData {
793
- nested : i. nested . into_iter ( ) . map ( f) . collect ( ) ,
794
- } )
795
- }
796
772
}
797
773
}
798
774
}
@@ -845,13 +821,6 @@ pub struct ImplSourceClosureData<'tcx, N> {
845
821
pub nested : Vec < N > ,
846
822
}
847
823
848
- #[ derive( Clone , PartialEq , Eq , TyEncodable , TyDecodable , HashStable , Lift ) ]
849
- #[ derive( TypeFoldable , TypeVisitable ) ]
850
- pub struct ImplSourceAutoImplData < N > {
851
- pub trait_def_id : DefId ,
852
- pub nested : Vec < N > ,
853
- }
854
-
855
824
#[ derive( Clone , PartialEq , Eq , TyEncodable , TyDecodable , HashStable , Lift ) ]
856
825
#[ derive( TypeFoldable , TypeVisitable ) ]
857
826
pub struct ImplSourceTraitUpcastingData < N > {
@@ -886,12 +855,6 @@ pub struct ImplSourceFnPointerData<'tcx, N> {
886
855
pub nested : Vec < N > ,
887
856
}
888
857
889
- #[ derive( Clone , PartialEq , Eq , TyEncodable , TyDecodable , HashStable , Lift ) ]
890
- #[ derive( TypeFoldable , TypeVisitable ) ]
891
- pub struct ImplSourceConstDestructData < N > {
892
- pub nested : Vec < N > ,
893
- }
894
-
895
858
#[ derive( Clone , PartialEq , Eq , TyEncodable , TyDecodable , HashStable , Lift ) ]
896
859
#[ derive( TypeFoldable , TypeVisitable ) ]
897
860
pub struct ImplSourceTraitAliasData < ' tcx , N > {
0 commit comments