@@ -33,7 +33,6 @@ use super::unify_key::{ConstVariableOrigin, ConstVariableOriginKind};
33
33
use super :: unify_key:: replace_if_possible;
34
34
35
35
use crate :: hir:: def_id:: DefId ;
36
- use crate :: mir:: interpret:: ConstValue ;
37
36
use crate :: ty:: { IntType , UintType } ;
38
37
use crate :: ty:: { self , Ty , TyCtxt , InferConst } ;
39
38
use crate :: ty:: error:: TypeError ;
@@ -137,8 +136,8 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> {
137
136
let a_is_expected = relation. a_is_expected ( ) ;
138
137
139
138
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) ) ) => {
142
141
self . const_unification_table
143
142
. borrow_mut ( )
144
143
. unify_var_var ( a_vid, b_vid)
@@ -147,16 +146,16 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> {
147
146
}
148
147
149
148
// 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)" )
153
152
}
154
153
155
- ( ConstValue :: Infer ( InferConst :: Var ( vid) ) , _) => {
154
+ ( ty :: ConstKind :: Infer ( InferConst :: Var ( vid) ) , _) => {
156
155
return self . unify_const_variable ( a_is_expected, vid, b) ;
157
156
}
158
157
159
- ( _, ConstValue :: Infer ( InferConst :: Var ( vid) ) ) => {
158
+ ( _, ty :: ConstKind :: Infer ( InferConst :: Var ( vid) ) ) => {
160
159
return self . unify_const_variable ( !a_is_expected, vid, a) ;
161
160
}
162
161
@@ -603,7 +602,7 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
603
602
assert_eq ! ( c, c2) ; // we are abusing TypeRelation here; both LHS and RHS ought to be ==
604
603
605
604
match c. val {
606
- ConstValue :: Infer ( InferConst :: Var ( vid) ) => {
605
+ ty :: ConstKind :: Infer ( InferConst :: Var ( vid) ) => {
607
606
let mut variable_table = self . infcx . const_unification_table . borrow_mut ( ) ;
608
607
let var_value = variable_table. probe_value ( vid) ;
609
608
match var_value. val {
0 commit comments