@@ -320,11 +320,11 @@ fn is_mixed_projection_predicate<'tcx>(
320320 && ( term_param_ty. index as usize ) < generics. parent_count
321321 {
322322 // The inner-most self type is a type parameter from the current function.
323- let mut projection_ty = projection_predicate. projection_ty ;
323+ let mut projection_ty = projection_predicate. projection_term ;
324324 loop {
325- match projection_ty. self_ty ( ) . kind ( ) {
325+ match * projection_ty. self_ty ( ) . kind ( ) {
326326 ty:: Alias ( ty:: Projection , inner_projection_ty) => {
327- projection_ty = * inner_projection_ty;
327+ projection_ty = inner_projection_ty. into ( ) ;
328328 } ,
329329 ty:: Param ( param_ty) => {
330330 return ( param_ty. index as usize ) >= generics. parent_count ;
@@ -404,14 +404,11 @@ fn replace_types<'tcx>(
404404 // The `replaced.insert(...)` check provides some protection against infinite loops.
405405 if replaced. insert ( param_ty. index ) {
406406 for projection_predicate in projection_predicates {
407- if projection_predicate. projection_ty . self_ty ( ) == param_ty. to_ty ( cx. tcx )
407+ if projection_predicate. projection_term . self_ty ( ) == param_ty. to_ty ( cx. tcx )
408408 && let Some ( term_ty) = projection_predicate. term . ty ( )
409409 && let ty:: Param ( term_param_ty) = term_ty. kind ( )
410410 {
411- let projection = cx. tcx . mk_ty_from_kind ( ty:: Alias (
412- ty:: Projection ,
413- projection_predicate. projection_ty . with_self_ty ( cx. tcx , new_ty) ,
414- ) ) ;
411+ let projection = projection_predicate. projection_term . with_self_ty ( cx. tcx , new_ty) . expect_ty ( cx. tcx ) . to_ty ( cx. tcx ) ;
415412
416413 if let Ok ( projected_ty) = cx. tcx . try_normalize_erasing_regions ( cx. param_env , projection)
417414 && args[ term_param_ty. index as usize ] != GenericArg :: from ( projected_ty)
0 commit comments