about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-01-30 19:42:49 +0000
committerbors <bors@rust-lang.org>2023-01-30 19:42:49 +0000
commit001a77fac33f6560ff361ff38f661ff5f1c6bf85 (patch)
treeb5ca79ba37c984829a54cef385f648d1193727d9
parenta322848c6b0e037c1f0209387558ecb6ab763714 (diff)
parent9346eb649d13120b6b0e84fd441aa527376c4127 (diff)
downloadrust-001a77fac33f6560ff361ff38f661ff5f1c6bf85.tar.gz
rust-001a77fac33f6560ff361ff38f661ff5f1c6bf85.zip
Auto merge of #107197 - aliemjay:patch-2, r=jackh726
assume MIR types are fully normalized in ascribe_user_type

This FIXME was introduced in c6a17bf8bcfa60c8b0436251d2cf70d8eca4d198 but it should've been restricted to `ascribe_user_type_skip_wf`.
-rw-r--r--compiler/rustc_borrowck/src/type_check/canonical.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_borrowck/src/type_check/canonical.rs b/compiler/rustc_borrowck/src/type_check/canonical.rs
index 11729e2c83f..2b81a35052d 100644
--- a/compiler/rustc_borrowck/src/type_check/canonical.rs
+++ b/compiler/rustc_borrowck/src/type_check/canonical.rs
@@ -181,9 +181,6 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
         user_ty: ty::UserType<'tcx>,
         span: Span,
     ) {
-        // FIXME: Ideally MIR types are normalized, but this is not always true.
-        let mir_ty = self.normalize(mir_ty, Locations::All(span));
-
         self.fully_perform_op(
             Locations::All(span),
             ConstraintCategory::Boring,
@@ -217,7 +214,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
             return;
         }
 
+        // FIXME: Ideally MIR types are normalized, but this is not always true.
         let mir_ty = self.normalize(mir_ty, Locations::All(span));
+
         let cause = ObligationCause::dummy_with_span(span);
         let param_env = self.param_env;
         let op = |infcx: &'_ _| {