about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJack Huey <31162821+jackh726@users.noreply.github.com>2022-09-16 17:52:04 -0400
committerJack Huey <31162821+jackh726@users.noreply.github.com>2022-09-17 11:46:04 -0400
commit1eb71f08932f0935584432f47900c5b6ee6844ba (patch)
tree2f304d6a0806f19c4530000ff094670477f47cc6
parente09242d5b82953652b5a898257d7c8f249d34bea (diff)
downloadrust-1eb71f08932f0935584432f47900c5b6ee6844ba.tar.gz
rust-1eb71f08932f0935584432f47900c5b6ee6844ba.zip
Add back in normalize call
-rw-r--r--compiler/rustc_traits/src/type_op.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/compiler/rustc_traits/src/type_op.rs b/compiler/rustc_traits/src/type_op.rs
index 1a63f853211..1bb6506b367 100644
--- a/compiler/rustc_traits/src/type_op.rs
+++ b/compiler/rustc_traits/src/type_op.rs
@@ -79,12 +79,15 @@ impl<'me, 'tcx> AscribeUserTypeCx<'me, 'tcx> {
     where
         T: TypeFoldable<'tcx>,
     {
+        self.normalize_with_cause(value, ObligationCause::misc(self.span, hir::CRATE_HIR_ID))
+    }
+
+    fn normalize_with_cause<T>(&mut self, value: T, cause: ObligationCause<'tcx>) -> T
+    where
+        T: TypeFoldable<'tcx>,
+    {
         self.infcx
-            .partially_normalize_associated_types_in(
-                ObligationCause::misc(self.span, hir::CRATE_HIR_ID),
-                self.param_env,
-                value,
-            )
+            .partially_normalize_associated_types_in(cause, self.param_env, value)
             .into_value_registering_obligations(self.infcx, self.fulfill_cx)
     }
 
@@ -154,6 +157,8 @@ impl<'me, 'tcx> AscribeUserTypeCx<'me, 'tcx> {
                 hir::CRATE_HIR_ID,
                 ObligationCauseCode::AscribeUserTypeProvePredicate(predicate_span),
             );
+            let instantiated_predicate =
+                self.normalize_with_cause(instantiated_predicate, cause.clone());
             self.prove_predicate(instantiated_predicate, cause);
         }