@@ -657,6 +657,9 @@ pub enum ImplSource<'tcx, N> {
657657 /// Successful resolution for a builtin trait.
658658 Builtin ( Vec < N > ) ,
659659
660+ // Unsizing a tuple like `(A, B, ..., X)` to `(A, B, ..., Y)` if `X` unsizes to `Y`
661+ TupleUnsizing ( Vec < N > ) ,
662+
660663 /// ImplSource for trait upcasting coercion
661664 TraitUpcasting ( ImplSourceTraitUpcastingData < N > ) ,
662665}
@@ -665,7 +668,7 @@ impl<'tcx, N> ImplSource<'tcx, N> {
665668 pub fn nested_obligations ( self ) -> Vec < N > {
666669 match self {
667670 ImplSource :: UserDefined ( i) => i. nested ,
668- ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) => n,
671+ ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) | ImplSource :: TupleUnsizing ( n ) => n,
669672 ImplSource :: Object ( d) => d. nested ,
670673 ImplSource :: TraitUpcasting ( d) => d. nested ,
671674 }
@@ -674,7 +677,7 @@ impl<'tcx, N> ImplSource<'tcx, N> {
674677 pub fn borrow_nested_obligations ( & self ) -> & [ N ] {
675678 match self {
676679 ImplSource :: UserDefined ( i) => & i. nested ,
677- ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) => & n,
680+ ImplSource :: Param ( n, _) | ImplSource :: Builtin ( n) | ImplSource :: TupleUnsizing ( n ) => & n,
678681 ImplSource :: Object ( d) => & d. nested ,
679682 ImplSource :: TraitUpcasting ( d) => & d. nested ,
680683 }
@@ -683,7 +686,7 @@ impl<'tcx, N> ImplSource<'tcx, N> {
683686 pub fn borrow_nested_obligations_mut ( & mut self ) -> & mut [ N ] {
684687 match self {
685688 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,
687690 ImplSource :: Object ( d) => & mut d. nested ,
688691 ImplSource :: TraitUpcasting ( d) => & mut d. nested ,
689692 }
@@ -701,6 +704,9 @@ impl<'tcx, N> ImplSource<'tcx, N> {
701704 } ) ,
702705 ImplSource :: Param ( n, ct) => ImplSource :: Param ( n. into_iter ( ) . map ( f) . collect ( ) , ct) ,
703706 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+ }
704710 ImplSource :: Object ( o) => ImplSource :: Object ( ImplSourceObjectData {
705711 vtable_base : o. vtable_base ,
706712 nested : o. nested . into_iter ( ) . map ( f) . collect ( ) ,
0 commit comments