@@ -320,11 +320,11 @@ fn is_mixed_projection_predicate<'tcx>(
320
320
&& ( term_param_ty. index as usize ) < generics. parent_count
321
321
{
322
322
// 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 ;
324
324
loop {
325
- match projection_ty. self_ty ( ) . kind ( ) {
325
+ match * projection_ty. self_ty ( ) . kind ( ) {
326
326
ty:: Alias ( ty:: Projection , inner_projection_ty) => {
327
- projection_ty = * inner_projection_ty;
327
+ projection_ty = inner_projection_ty. into ( ) ;
328
328
} ,
329
329
ty:: Param ( param_ty) => {
330
330
return ( param_ty. index as usize ) >= generics. parent_count ;
@@ -404,14 +404,11 @@ fn replace_types<'tcx>(
404
404
// The `replaced.insert(...)` check provides some protection against infinite loops.
405
405
if replaced. insert ( param_ty. index ) {
406
406
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 )
408
408
&& let Some ( term_ty) = projection_predicate. term . ty ( )
409
409
&& let ty:: Param ( term_param_ty) = term_ty. kind ( )
410
410
{
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 ) ;
415
412
416
413
if let Ok ( projected_ty) = cx. tcx . try_normalize_erasing_regions ( cx. param_env , projection)
417
414
&& args[ term_param_ty. index as usize ] != GenericArg :: from ( projected_ty)
0 commit comments