@@ -46,7 +46,7 @@ use self::region_constraints::{GenericKind, RegionConstraintData, VarInfos, Veri
4646use self :: region_constraints:: {
4747 RegionConstraintCollector , RegionConstraintStorage , RegionSnapshot ,
4848} ;
49- use self :: type_variable:: { Diverging , TypeVariableOrigin , TypeVariableOriginKind } ;
49+ use self :: type_variable:: { TypeVariableOrigin , TypeVariableOriginKind } ;
5050
5151pub mod at;
5252pub mod canonical;
@@ -701,23 +701,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
701701 t. fold_with ( & mut self . freshener ( ) )
702702 }
703703
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-
721704 /// Returns the origin of the type variable identified by `vid`, or `None`
722705 /// if this is not a type variable.
723706 ///
@@ -1081,31 +1064,23 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
10811064 self . inner . borrow_mut ( ) . type_variables ( ) . num_vars ( )
10821065 }
10831066
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)
10861069 }
10871070
10881071 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) )
10901073 }
10911074
10921075 pub fn next_ty_var_in_universe (
10931076 & self ,
10941077 origin : TypeVariableOrigin ,
10951078 universe : ty:: UniverseIndex ,
10961079 ) -> 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) ;
11021081 self . tcx . mk_ty_var ( vid)
11031082 }
11041083
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-
11091084 pub fn next_const_var (
11101085 & self ,
11111086 ty : Ty < ' tcx > ,
@@ -1217,7 +1192,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
12171192 // as the substitutions for the default, `(T, U)`.
12181193 let ty_var_id = self . inner . borrow_mut ( ) . type_variables ( ) . new_var (
12191194 self . universe ( ) ,
1220- Diverging :: NotDiverging ,
12211195 TypeVariableOrigin {
12221196 kind : TypeVariableOriginKind :: TypeParameterDefinition (
12231197 param. name ,
0 commit comments