@@ -46,7 +46,7 @@ use self::region_constraints::{GenericKind, RegionConstraintData, VarInfos, Veri
46
46
use self :: region_constraints:: {
47
47
RegionConstraintCollector , RegionConstraintStorage , RegionSnapshot ,
48
48
} ;
49
- use self :: type_variable:: { Diverging , TypeVariableOrigin , TypeVariableOriginKind } ;
49
+ use self :: type_variable:: { TypeVariableOrigin , TypeVariableOriginKind } ;
50
50
51
51
pub mod at;
52
52
pub mod canonical;
@@ -701,23 +701,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
701
701
t. fold_with ( & mut self . freshener ( ) )
702
702
}
703
703
704
- /// Returns whether `ty` is a diverging type variable or not.
705
- /// (If `ty` is not a type variable at all, returns not diverging.)
706
- ///
707
- /// No attempt is made to resolve `ty`.
708
- pub fn type_var_diverges ( & ' a self , ty : Ty < ' _ > ) -> Diverging {
709
- match * ty. kind ( ) {
710
- ty:: Infer ( ty:: TyVar ( vid) ) => self . ty_vid_diverges ( vid) ,
711
- _ => Diverging :: NotDiverging ,
712
- }
713
- }
714
-
715
- /// Returns true if the type inference variable `vid` was created
716
- /// as a diverging type variable. No attempt is made to resolve `vid`.
717
- pub fn ty_vid_diverges ( & ' a self , vid : ty:: TyVid ) -> Diverging {
718
- self . inner . borrow_mut ( ) . type_variables ( ) . var_diverges ( vid)
719
- }
720
-
721
704
/// Returns the origin of the type variable identified by `vid`, or `None`
722
705
/// if this is not a type variable.
723
706
///
@@ -1081,31 +1064,23 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1081
1064
self . inner . borrow_mut ( ) . type_variables ( ) . num_vars ( )
1082
1065
}
1083
1066
1084
- pub fn next_ty_var_id ( & self , diverging : Diverging , origin : TypeVariableOrigin ) -> TyVid {
1085
- self . inner . borrow_mut ( ) . type_variables ( ) . new_var ( self . universe ( ) , diverging , origin)
1067
+ pub fn next_ty_var_id ( & self , origin : TypeVariableOrigin ) -> TyVid {
1068
+ self . inner . borrow_mut ( ) . type_variables ( ) . new_var ( self . universe ( ) , origin)
1086
1069
}
1087
1070
1088
1071
pub fn next_ty_var ( & self , origin : TypeVariableOrigin ) -> Ty < ' tcx > {
1089
- self . tcx . mk_ty_var ( self . next_ty_var_id ( Diverging :: NotDiverging , origin) )
1072
+ self . tcx . mk_ty_var ( self . next_ty_var_id ( origin) )
1090
1073
}
1091
1074
1092
1075
pub fn next_ty_var_in_universe (
1093
1076
& self ,
1094
1077
origin : TypeVariableOrigin ,
1095
1078
universe : ty:: UniverseIndex ,
1096
1079
) -> Ty < ' tcx > {
1097
- let vid = self . inner . borrow_mut ( ) . type_variables ( ) . new_var (
1098
- universe,
1099
- Diverging :: NotDiverging ,
1100
- origin,
1101
- ) ;
1080
+ let vid = self . inner . borrow_mut ( ) . type_variables ( ) . new_var ( universe, origin) ;
1102
1081
self . tcx . mk_ty_var ( vid)
1103
1082
}
1104
1083
1105
- pub fn next_diverging_ty_var ( & self , origin : TypeVariableOrigin ) -> Ty < ' tcx > {
1106
- self . tcx . mk_ty_var ( self . next_ty_var_id ( Diverging :: Diverges , origin) )
1107
- }
1108
-
1109
1084
pub fn next_const_var (
1110
1085
& self ,
1111
1086
ty : Ty < ' tcx > ,
@@ -1217,7 +1192,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1217
1192
// as the substitutions for the default, `(T, U)`.
1218
1193
let ty_var_id = self . inner . borrow_mut ( ) . type_variables ( ) . new_var (
1219
1194
self . universe ( ) ,
1220
- Diverging :: NotDiverging ,
1221
1195
TypeVariableOrigin {
1222
1196
kind : TypeVariableOriginKind :: TypeParameterDefinition (
1223
1197
param. name ,
0 commit comments