]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_infer/src/infer/combine.rs
const_evaluatable_checked: fix occurs check
[rust.git] / compiler / rustc_infer / src / infer / combine.rs
index 6a1715ef8189992e1b6742cda5c1bd72b34fbee4..594e2c6205f85e9d4129f941b027904f7594f50e 100644 (file)
@@ -543,6 +543,10 @@ fn a_is_expected(&self) -> bool {
         true
     }
 
+    fn visit_ct_substs(&self) -> bool {
+        true
+    }
+
     fn binders<T>(
         &mut self,
         a: ty::Binder<T>,
@@ -716,7 +720,10 @@ fn consts(
                 let variable_table = &mut inner.const_unification_table();
                 let var_value = variable_table.probe_value(vid);
                 match var_value.val {
-                    ConstVariableValue::Known { value: u } => self.relate(u, u),
+                    ConstVariableValue::Known { value: u } => {
+                        drop(inner);
+                        self.relate(u, u)
+                    }
                     ConstVariableValue::Unknown { universe } => {
                         if self.for_universe.can_name(universe) {
                             Ok(c)
@@ -815,6 +822,10 @@ fn a_is_expected(&self) -> bool {
         true
     }
 
+    fn visit_ct_substs(&self) -> bool {
+        true
+    }
+
     fn relate_with_variance<T: Relate<'tcx>>(
         &mut self,
         _variance: ty::Variance,
@@ -870,6 +881,9 @@ fn tys(&mut self, t: Ty<'tcx>, _t: Ty<'tcx>) -> RelateResult<'tcx, Ty<'tcx>> {
                     }
                 }
             }
+            ty::Infer(ty::IntVar(_) | ty::FloatVar(_)) => {
+                Ok(t)
+            }
             _ => relate::super_relate_tys(self, t, t),
         }
     }