@@ -43,7 +43,7 @@ use super::type_variable::{RelationDir, BiTo, EqTo, SubtypeOf, SupertypeOf};
43
43
44
44
use middle:: ty:: { TyVar } ;
45
45
use middle:: ty:: { IntType , UintType } ;
46
- use middle:: ty:: { self , Ty } ;
46
+ use middle:: ty:: { self , Ty , TypeError } ;
47
47
use middle:: ty_fold;
48
48
use middle:: ty_fold:: { TypeFolder , TypeFoldable } ;
49
49
use middle:: ty_relate:: { self , Relate , RelateResult , TypeRelation } ;
@@ -108,7 +108,7 @@ pub fn super_combine_tys<'a,'tcx:'a,R>(infcx: &InferCtxt<'a, 'tcx>,
108
108
// All other cases of inference are errors
109
109
( & ty:: TyInfer ( _) , _) |
110
110
( _, & ty:: TyInfer ( _) ) => {
111
- Err ( ty :: terr_sorts ( ty_relate:: expected_found ( relation, & a, & b) ) )
111
+ Err ( TypeError :: Sorts ( ty_relate:: expected_found ( relation, & a, & b) ) )
112
112
}
113
113
114
114
@@ -278,7 +278,7 @@ impl<'a, 'tcx> CombineFields<'a, 'tcx> {
278
278
} ;
279
279
let u = ty. fold_with ( & mut generalize) ;
280
280
if generalize. cycle_detected {
281
- Err ( ty :: terr_cyclic_ty )
281
+ Err ( TypeError :: CyclicTy )
282
282
} else {
283
283
Ok ( u)
284
284
}
@@ -363,12 +363,12 @@ impl<'cx, 'tcx> ty_fold::TypeFolder<'tcx> for Generalizer<'cx, 'tcx> {
363
363
364
364
pub trait RelateResultCompare < ' tcx , T > {
365
365
fn compare < F > ( & self , t : T , f : F ) -> RelateResult < ' tcx , T > where
366
- F : FnOnce ( ) -> ty:: type_err < ' tcx > ;
366
+ F : FnOnce ( ) -> ty:: TypeError < ' tcx > ;
367
367
}
368
368
369
369
impl < ' tcx , T : Clone + PartialEq > RelateResultCompare < ' tcx , T > for RelateResult < ' tcx , T > {
370
370
fn compare < F > ( & self , t : T , f : F ) -> RelateResult < ' tcx , T > where
371
- F : FnOnce ( ) -> ty:: type_err < ' tcx > ,
371
+ F : FnOnce ( ) -> ty:: TypeError < ' tcx > ,
372
372
{
373
373
self . clone ( ) . and_then ( |s| {
374
374
if s == t {
@@ -381,16 +381,16 @@ impl<'tcx, T:Clone + PartialEq> RelateResultCompare<'tcx, T> for RelateResult<'t
381
381
}
382
382
383
383
fn int_unification_error < ' tcx > ( a_is_expected : bool , v : ( ty:: IntVarValue , ty:: IntVarValue ) )
384
- -> ty:: type_err < ' tcx >
384
+ -> ty:: TypeError < ' tcx >
385
385
{
386
386
let ( a, b) = v;
387
- ty :: terr_int_mismatch ( ty_relate:: expected_found_bool ( a_is_expected, & a, & b) )
387
+ TypeError :: IntMismatch ( ty_relate:: expected_found_bool ( a_is_expected, & a, & b) )
388
388
}
389
389
390
390
fn float_unification_error < ' tcx > ( a_is_expected : bool ,
391
391
v : ( ast:: FloatTy , ast:: FloatTy ) )
392
- -> ty:: type_err < ' tcx >
392
+ -> ty:: TypeError < ' tcx >
393
393
{
394
394
let ( a, b) = v;
395
- ty :: terr_float_mismatch ( ty_relate:: expected_found_bool ( a_is_expected, & a, & b) )
395
+ TypeError :: FloatMismatch ( ty_relate:: expected_found_bool ( a_is_expected, & a, & b) )
396
396
}
0 commit comments