about summary refs log tree commit diff
path: root/compiler/rustc_borrowck
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-05-28 21:13:58 +0000
committerMichael Goulet <michael@errs.io>2025-05-29 11:20:45 +0000
commit9871e160eae4376dea2b9fa3aa1ccca3607fc1c3 (patch)
tree4957b642facbb273977969189cded7d1328fc8ee /compiler/rustc_borrowck
parent2a339ce492349a27c80a0bb9e63510f1798beae1 (diff)
Normalize possibly unnormalized type in relate_type_and_user_type
Diffstat (limited to 'compiler/rustc_borrowck')
-rw-r--r--compiler/rustc_borrowck/src/type_check/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs
index 4d57e7aac58..3c95ebf9ffa 100644
--- a/compiler/rustc_borrowck/src/type_check/mod.rs
+++ b/compiler/rustc_borrowck/src/type_check/mod.rs
@@ -482,6 +482,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
         }
         trace!(?curr_projected_ty);
 
+        // Need to renormalize `a` as typecheck may have failed to normalize
+        // higher-ranked aliases if normalization was ambiguous due to inference.
+        let a = self.normalize(a, locations);
         let ty = self.normalize(curr_projected_ty.ty, locations);
         self.relate_types(ty, v.xform(ty::Contravariant), a, locations, category)?;