@@ -33,7 +33,6 @@ use super::unify_key::{ConstVariableOrigin, ConstVariableOriginKind};
3333use super :: unify_key:: replace_if_possible;
3434
3535use crate :: hir:: def_id:: DefId ;
36- use crate :: mir:: interpret:: ConstValue ;
3736use crate :: ty:: { IntType , UintType } ;
3837use crate :: ty:: { self , Ty , TyCtxt , InferConst } ;
3938use crate :: ty:: error:: TypeError ;
@@ -137,8 +136,8 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> {
137136 let a_is_expected = relation. a_is_expected ( ) ;
138137
139138 match ( a. val , b. val ) {
140- ( ConstValue :: Infer ( InferConst :: Var ( a_vid) ) ,
141- ConstValue :: Infer ( InferConst :: Var ( b_vid) ) ) => {
139+ ( ty :: ConstKind :: Infer ( InferConst :: Var ( a_vid) ) ,
140+ ty :: ConstKind :: Infer ( InferConst :: Var ( b_vid) ) ) => {
142141 self . const_unification_table
143142 . borrow_mut ( )
144143 . unify_var_var ( a_vid, b_vid)
@@ -147,16 +146,16 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> {
147146 }
148147
149148 // All other cases of inference with other variables are errors.
150- ( ConstValue :: Infer ( InferConst :: Var ( _) ) , ConstValue :: Infer ( _) ) |
151- ( ConstValue :: Infer ( _) , ConstValue :: Infer ( InferConst :: Var ( _) ) ) => {
152- bug ! ( "tried to combine ConstValue ::Infer/ConstValue ::Infer(InferConst::Var)" )
149+ ( ty :: ConstKind :: Infer ( InferConst :: Var ( _) ) , ty :: ConstKind :: Infer ( _) ) |
150+ ( ty :: ConstKind :: Infer ( _) , ty :: ConstKind :: Infer ( InferConst :: Var ( _) ) ) => {
151+ bug ! ( "tried to combine ConstKind ::Infer/ConstKind ::Infer(InferConst::Var)" )
153152 }
154153
155- ( ConstValue :: Infer ( InferConst :: Var ( vid) ) , _) => {
154+ ( ty :: ConstKind :: Infer ( InferConst :: Var ( vid) ) , _) => {
156155 return self . unify_const_variable ( a_is_expected, vid, b) ;
157156 }
158157
159- ( _, ConstValue :: Infer ( InferConst :: Var ( vid) ) ) => {
158+ ( _, ty :: ConstKind :: Infer ( InferConst :: Var ( vid) ) ) => {
160159 return self . unify_const_variable ( !a_is_expected, vid, a) ;
161160 }
162161
@@ -603,7 +602,7 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
603602 assert_eq ! ( c, c2) ; // we are abusing TypeRelation here; both LHS and RHS ought to be ==
604603
605604 match c. val {
606- ConstValue :: Infer ( InferConst :: Var ( vid) ) => {
605+ ty :: ConstKind :: Infer ( InferConst :: Var ( vid) ) => {
607606 let mut variable_table = self . infcx . const_unification_table . borrow_mut ( ) ;
608607 let var_value = variable_table. probe_value ( vid) ;
609608 match var_value. val {
0 commit comments