- }
- ty::ExistentialPredicate::Projection(projection) => {
- let name = cx.tcx.associated_item(projection.item_def_id).ident;
- cx.push("p");
- cx.push_ident(&name.as_str());
- cx = projection.ty.print(cx)?;
- }
- ty::ExistentialPredicate::AutoTrait(def_id) => {
- cx = cx.print_def_path(*def_id, &[])?;
- }
+ while let Some(projection_pred) = predicate_iter.next_if(|p| {
+ matches!(p.skip_binder(), ty::ExistentialPredicate::Projection(_))
+ }) {
+ let projection = match projection_pred.skip_binder() {
+ ty::ExistentialPredicate::Projection(projection) => projection,
+ _ => unreachable!(),
+ };
+ let name = cx.tcx.associated_item(projection.item_def_id).ident;
+ cx.push("p");
+ cx.push_ident(&name.as_str());
+ cx = projection.ty.print(cx)?;
+ }
+ Ok(cx)
+ })?;