@@ -633,7 +633,10 @@ impl LowerWithEnv for ProjectionTy {
633
633
substitution : trait_substitution,
634
634
} = trait_ref. lower ( env) ?;
635
635
let lookup = env. lookup_associated_ty ( trait_id, name) ?;
636
- let mut args: Vec < _ > = args
636
+
637
+ let mut all_args: Vec < _ > = trait_substitution. iter ( interner) . cloned ( ) . collect ( ) ;
638
+
639
+ let args: Vec < _ > = args
637
640
. iter ( )
638
641
. map ( |a| a. lower ( env) )
639
642
. collect :: < LowerResult < _ > > ( ) ?;
@@ -656,11 +659,11 @@ impl LowerWithEnv for ProjectionTy {
656
659
}
657
660
}
658
661
659
- args . extend ( trait_substitution . iter ( interner ) . cloned ( ) ) ;
662
+ all_args . extend ( args . into_iter ( ) ) ;
660
663
661
664
Ok ( chalk_ir:: ProjectionTy {
662
665
associated_ty_id : lookup. id ,
663
- substitution : chalk_ir:: Substitution :: from_iter ( interner, args ) ,
666
+ substitution : chalk_ir:: Substitution :: from_iter ( interner, all_args ) ,
664
667
} )
665
668
}
666
669
}
@@ -1024,9 +1027,8 @@ pub fn lower_goal(goal: &Goal, program: &LoweredProgram) -> LowerResult<chalk_ir
1024
1027
. map ( |( & associated_ty_id, datum) | {
1025
1028
let trait_datum = & program. trait_data [ & datum. trait_id ] ;
1026
1029
let num_trait_params = trait_datum. binders . len ( interner) ;
1027
- let num_addl_params = datum. binders . len ( interner) - num_trait_params;
1028
1030
let addl_variable_kinds =
1029
- datum. binders . binders . as_slice ( interner) [ ..num_addl_params ] . to_owned ( ) ;
1031
+ datum. binders . binders . as_slice ( interner) [ num_trait_params.. ] . to_owned ( ) ;
1030
1032
let lookup = AssociatedTyLookup {
1031
1033
id : associated_ty_id,
1032
1034
addl_variable_kinds,
0 commit comments