diff options
| author | Michael Goulet <michael@errs.io> | 2022-08-31 04:03:24 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-09-09 01:31:44 +0000 |
| commit | d34cb98fb0bbaf86860b4ad5ff0c3d79b077f565 (patch) | |
| tree | 31f9a2b56052f3bfed4ee797ffca15678c985cb6 /compiler/rustc_trait_selection/src | |
| parent | 78b962a4f348c0b901d2eae9e5852cb3675b1233 (diff) | |
| download | rust-d34cb98fb0bbaf86860b4ad5ff0c3d79b077f565.tar.gz rust-d34cb98fb0bbaf86860b4ad5ff0c3d79b077f565.zip | |
Lower RPITIT to ImplTraitPlaceholder item
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/project.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index 8a093bf4281..cd6b42be5ad 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -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())); |
