]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/infer/sub.rs
Replace ConstVariableTable with UnificationTable
[rust.git] / src / librustc / infer / sub.rs
index b285d59729110706964e151360e6e126a67a1a3b..1b34403f0533997d3466b886ac9df33d6cb74e01 100644 (file)
@@ -6,6 +6,7 @@
 use crate::ty::TyVar;
 use crate::ty::fold::TypeFoldable;
 use crate::ty::relate::{Cause, Relate, RelateResult, TypeRelation};
+use crate::infer::unify_key::replace_if_possible;
 use crate::mir::interpret::ConstValue;
 use std::mem;
 
@@ -143,8 +144,8 @@ fn consts(
         if a == b { return Ok(a); }
 
         let infcx = self.fields.infcx;
-        let a = infcx.const_unification_table.borrow_mut().replace_if_possible(a);
-        let b = infcx.const_unification_table.borrow_mut().replace_if_possible(b);
+        let a = replace_if_possible(infcx.const_unification_table.borrow_mut(), a);
+        let b = replace_if_possible(infcx.const_unification_table.borrow_mut(), b);
 
         // Consts can only be equal or unequal to each other: there's no subtyping
         // relation, so we're just going to perform equating here instead.