Lower RPITIT to ImplTraitPlaceholder item

This commit is contained in:
Michael Goulet 2022-08-31 04:03:24 +00:00
parent 78b962a4f3
commit d34cb98fb0
11 changed files with 99 additions and 8 deletions

View file

@ -1465,6 +1465,11 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
obligation: &ProjectionTyObligation<'tcx>,
candidate_set: &mut ProjectionCandidateSet<'tcx>,
) {
// Can't assemble candidate from impl for RPITIT
if selcx.tcx().def_kind(obligation.predicate.item_def_id) == DefKind::ImplTraitPlaceholder {
return;
}
// If we are resolving `<T as TraitRef<...>>::Item == Type`,
// start out by selecting the predicate `T as TraitRef<...>`:
let poly_trait_ref = ty::Binder::dummy(obligation.predicate.trait_ref(selcx.tcx()));