@@ -657,6 +657,9 @@ pub enum ImplSource<'tcx, N> {
657
657
/// Successful resolution for a builtin trait.
658
658
Builtin ( Vec < N > ) ,
659
659
660
+ // Unsizing a tuple like `(A, B, ..., X)` to `(A, B, ..., Y)` if `X` unsizes to `Y`
661
+ TupleUnsizing ( Vec < N > ) ,
662
+
660
663
/// ImplSource for trait upcasting coercion
661
664
TraitUpcasting ( ImplSourceTraitUpcastingData < N > ) ,
662
665
}
@@ -665,7 +668,7 @@ impl<'tcx, N> ImplSource<'tcx, N> {
665
668
pub fn nested_obligations ( self ) -> Vec < N > {
666
669
match self {
667
670
ImplSource :: UserDefined ( i) => i. nested ,
668
- ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) => n,
671
+ ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) | ImplSource :: TupleUnsizing ( n ) => n,
669
672
ImplSource :: Object ( d) => d. nested ,
670
673
ImplSource :: TraitUpcasting ( d) => d. nested ,
671
674
}
@@ -674,7 +677,7 @@ impl<'tcx, N> ImplSource<'tcx, N> {
674
677
pub fn borrow_nested_obligations ( & self ) -> & [ N ] {
675
678
match self {
676
679
ImplSource :: UserDefined ( i) => & i. nested ,
677
- ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) => & n,
680
+ ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) | ImplSource :: TupleUnsizing ( n ) => & n,
678
681
ImplSource :: Object ( d) => & d. nested ,
679
682
ImplSource :: TraitUpcasting ( d) => & d. nested ,
680
683
}
@@ -683,7 +686,7 @@ impl<'tcx, N> ImplSource<'tcx, N> {
683
686
pub fn borrow_nested_obligations_mut ( & mut self ) -> & mut [ N ] {
684
687
match self {
685
688
ImplSource :: UserDefined ( i) => & mut i. nested ,
686
- ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) => n,
689
+ ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) | ImplSource :: TupleUnsizing ( n ) => n,
687
690
ImplSource :: Object ( d) => & mut d. nested ,
688
691
ImplSource :: TraitUpcasting ( d) => & mut d. nested ,
689
692
}
@@ -701,6 +704,9 @@ impl<'tcx, N> ImplSource<'tcx, N> {
701
704
} ) ,
702
705
ImplSource :: Param ( n, ct) => ImplSource :: Param ( n. into_iter ( ) . map ( f) . collect ( ) , ct) ,
703
706
ImplSource :: Builtin ( n) => ImplSource :: Builtin ( n. into_iter ( ) . map ( f) . collect ( ) ) ,
707
+ ImplSource :: TupleUnsizing ( n) => {
708
+ ImplSource :: TupleUnsizing ( n. into_iter ( ) . map ( f) . collect ( ) )
709
+ }
704
710
ImplSource :: Object ( o) => ImplSource :: Object ( ImplSourceObjectData {
705
711
vtable_base : o. vtable_base ,
706
712
nested : o. nested . into_iter ( ) . map ( f) . collect ( ) ,
0 commit comments