about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2022-11-08 21:03:54 -0500
committerGitHub <noreply@github.com>2022-11-08 21:03:54 -0500
commit6c021cf07d8e47d33b8d764b9505d3442177e241 (patch)
tree796032b98b22954d5dc633c605247c2c0550d739 /compiler/rustc_middle/src
parent83e73e013d2e6eacadc6abc83a6cdc4b78c293b1 (diff)
parent0f632c8f7882a4470bf1c7b6a4d6b14379b8e163 (diff)
Rollup merge of #103827 - compiler-errors:rpitit-substs-compat, r=wesleywiser
Properly remap and check for substs compatibility in `confirm_impl_trait_in_trait_candidate`

Fixes #103824
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/ty/error.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/error.rs b/compiler/rustc_middle/src/ty/error.rs
index 4e6cdb78602..dc13374f992 100644
--- a/compiler/rustc_middle/src/ty/error.rs
+++ b/compiler/rustc_middle/src/ty/error.rs
@@ -430,7 +430,9 @@ impl<'tcx> TyCtxt<'tcx> {
                     (ty::Projection(_), ty::Projection(_)) => {
                         diag.note("an associated type was expected, but a different one was found");
                     }
-                    (ty::Param(p), ty::Projection(proj)) | (ty::Projection(proj), ty::Param(p)) => {
+                    (ty::Param(p), ty::Projection(proj)) | (ty::Projection(proj), ty::Param(p))
+                        if self.def_kind(proj.item_def_id) != DefKind::ImplTraitPlaceholder =>
+                    {
                         let generics = self.generics_of(body_owner_def_id);
                         let p_span = self.def_span(generics.type_param(p, self).def_id);
                         if !sp.contains(p_span) {