]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_infer/infer/sub.rs
perf: Reduce snapshot/rollback overhead
[rust.git] / src / librustc_infer / infer / sub.rs
index 080af37492d89a4eb56e50ad9fd56b70fb455ef2..0abcc15d6fcd8b7f633a6f5fb5fbe0535b4bf746 100644 (file)
@@ -80,8 +80,8 @@ fn tys(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) -> RelateResult<'tcx, Ty<'tcx>> {
         }
 
         let infcx = self.fields.infcx;
-        let a = infcx.inner.borrow_mut().type_variables.replace_if_possible(a);
-        let b = infcx.inner.borrow_mut().type_variables.replace_if_possible(b);
+        let a = infcx.inner.borrow_mut().type_variables().replace_if_possible(a);
+        let b = infcx.inner.borrow_mut().type_variables().replace_if_possible(b);
         match (&a.kind, &b.kind) {
             (&ty::Infer(TyVar(a_vid)), &ty::Infer(TyVar(b_vid))) => {
                 // Shouldn't have any LBR here, so we can safely put
@@ -95,7 +95,7 @@ fn tys(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) -> RelateResult<'tcx, Ty<'tcx>> {
                 // have to record in the `type_variables` tracker that
                 // the two variables are equal modulo subtyping, which
                 // is important to the occurs check later on.
-                infcx.inner.borrow_mut().type_variables.sub(a_vid, b_vid);
+                infcx.inner.borrow_mut().type_variables().sub(a_vid, b_vid);
                 self.fields.obligations.push(Obligation::new(
                     self.fields.trace.cause.clone(),
                     self.fields.param_env,