about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAli MJ Al-Nasrawy <alimjalnasrawy@gmail.com>2023-01-22 16:48:58 +0300
committerGitHub <noreply@github.com>2023-01-22 16:48:58 +0300
commit9346eb649d13120b6b0e84fd441aa527376c4127 (patch)
tree02d5e31cc765bcafcbdc02d546921a1e98547c02
parent8e6809072304b147f9e98d55c87f42c0f3959679 (diff)
downloadrust-9346eb649d13120b6b0e84fd441aa527376c4127.tar.gz
rust-9346eb649d13120b6b0e84fd441aa527376c4127.zip
assume MIR types are fully normalized
-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: &'_ _| {