@@ -76,44 +76,44 @@ impl<'infcx, 'gcx, 'tcx> InferCtxt<'infcx, 'gcx, 'tcx> {
76
76
77
77
match ( & a. sty , & b. sty ) {
78
78
// Relate integral variables to other types
79
- ( & ty:: TyInfer ( ty:: IntVar ( a_id) ) , & ty:: TyInfer ( ty:: IntVar ( b_id) ) ) => {
79
+ ( & ty:: Infer ( ty:: IntVar ( a_id) ) , & ty:: Infer ( ty:: IntVar ( b_id) ) ) => {
80
80
self . int_unification_table
81
81
. borrow_mut ( )
82
82
. unify_var_var ( a_id, b_id)
83
83
. map_err ( |e| int_unification_error ( a_is_expected, e) ) ?;
84
84
Ok ( a)
85
85
}
86
- ( & ty:: TyInfer ( ty:: IntVar ( v_id) ) , & ty:: TyInt ( v) ) => {
86
+ ( & ty:: Infer ( ty:: IntVar ( v_id) ) , & ty:: TyInt ( v) ) => {
87
87
self . unify_integral_variable ( a_is_expected, v_id, IntType ( v) )
88
88
}
89
- ( & ty:: TyInt ( v) , & ty:: TyInfer ( ty:: IntVar ( v_id) ) ) => {
89
+ ( & ty:: TyInt ( v) , & ty:: Infer ( ty:: IntVar ( v_id) ) ) => {
90
90
self . unify_integral_variable ( !a_is_expected, v_id, IntType ( v) )
91
91
}
92
- ( & ty:: TyInfer ( ty:: IntVar ( v_id) ) , & ty:: TyUint ( v) ) => {
92
+ ( & ty:: Infer ( ty:: IntVar ( v_id) ) , & ty:: TyUint ( v) ) => {
93
93
self . unify_integral_variable ( a_is_expected, v_id, UintType ( v) )
94
94
}
95
- ( & ty:: TyUint ( v) , & ty:: TyInfer ( ty:: IntVar ( v_id) ) ) => {
95
+ ( & ty:: TyUint ( v) , & ty:: Infer ( ty:: IntVar ( v_id) ) ) => {
96
96
self . unify_integral_variable ( !a_is_expected, v_id, UintType ( v) )
97
97
}
98
98
99
99
// Relate floating-point variables to other types
100
- ( & ty:: TyInfer ( ty:: FloatVar ( a_id) ) , & ty:: TyInfer ( ty:: FloatVar ( b_id) ) ) => {
100
+ ( & ty:: Infer ( ty:: FloatVar ( a_id) ) , & ty:: Infer ( ty:: FloatVar ( b_id) ) ) => {
101
101
self . float_unification_table
102
102
. borrow_mut ( )
103
103
. unify_var_var ( a_id, b_id)
104
104
. map_err ( |e| float_unification_error ( relation. a_is_expected ( ) , e) ) ?;
105
105
Ok ( a)
106
106
}
107
- ( & ty:: TyInfer ( ty:: FloatVar ( v_id) ) , & ty:: TyFloat ( v) ) => {
107
+ ( & ty:: Infer ( ty:: FloatVar ( v_id) ) , & ty:: TyFloat ( v) ) => {
108
108
self . unify_float_variable ( a_is_expected, v_id, v)
109
109
}
110
- ( & ty:: TyFloat ( v) , & ty:: TyInfer ( ty:: FloatVar ( v_id) ) ) => {
110
+ ( & ty:: TyFloat ( v) , & ty:: Infer ( ty:: FloatVar ( v_id) ) ) => {
111
111
self . unify_float_variable ( !a_is_expected, v_id, v)
112
112
}
113
113
114
114
// All other cases of inference are errors
115
- ( & ty:: TyInfer ( _) , _) |
116
- ( _, & ty:: TyInfer ( _) ) => {
115
+ ( & ty:: Infer ( _) , _) |
116
+ ( _, & ty:: Infer ( _) ) => {
117
117
Err ( TypeError :: Sorts ( ty:: relate:: expected_found ( relation, & a, & b) ) )
118
118
}
119
119
@@ -393,7 +393,7 @@ impl<'cx, 'gcx, 'tcx> TypeRelation<'cx, 'gcx, 'tcx> for Generalizer<'cx, 'gcx, '
393
393
// subtyping. This is basically our "occurs check", preventing
394
394
// us from creating infinitely sized types.
395
395
match t. sty {
396
- ty:: TyInfer ( ty:: TyVar ( vid) ) => {
396
+ ty:: Infer ( ty:: TyVar ( vid) ) => {
397
397
let mut variables = self . infcx . type_variables . borrow_mut ( ) ;
398
398
let vid = variables. root_var ( vid) ;
399
399
let sub_vid = variables. sub_root_var ( vid) ;
@@ -433,8 +433,8 @@ impl<'cx, 'gcx, 'tcx> TypeRelation<'cx, 'gcx, 'tcx> for Generalizer<'cx, 'gcx, '
433
433
}
434
434
}
435
435
}
436
- ty:: TyInfer ( ty:: IntVar ( _) ) |
437
- ty:: TyInfer ( ty:: FloatVar ( _) ) => {
436
+ ty:: Infer ( ty:: IntVar ( _) ) |
437
+ ty:: Infer ( ty:: FloatVar ( _) ) => {
438
438
// No matter what mode we are in,
439
439
// integer/floating-point types must be equal to be
440
440
// relatable.
0 commit comments