@@ -1174,7 +1174,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
11741174 /// Process the region constraints and report any errors that
11751175 /// result. After this, no more unification operations should be
11761176 /// done -- or the compiler will panic -- but it is legal to use
1177- /// `resolve_type_vars_if_possible ` as well as `fully_resolve`.
1177+ /// `resolve_vars_if_possible ` as well as `fully_resolve`.
11781178 pub fn resolve_regions_and_report_errors (
11791179 & self ,
11801180 region_context : DefId ,
@@ -1262,7 +1262,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
12621262 }
12631263
12641264 pub fn ty_to_string ( & self , t : Ty < ' tcx > ) -> String {
1265- self . resolve_type_vars_if_possible ( & t) . to_string ( )
1265+ self . resolve_vars_if_possible ( & t) . to_string ( )
12661266 }
12671267
12681268 pub fn tys_to_string ( & self , ts : & [ Ty < ' tcx > ] ) -> String {
@@ -1271,7 +1271,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
12711271 }
12721272
12731273 pub fn trait_ref_to_string ( & self , t : & ty:: TraitRef < ' tcx > ) -> String {
1274- self . resolve_type_vars_if_possible ( t) . to_string ( )
1274+ self . resolve_vars_if_possible ( t) . to_string ( )
12751275 }
12761276
12771277 /// If `TyVar(vid)` resolves to a type, return that type. Else, return the
@@ -1297,28 +1297,28 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
12971297 self . type_variables . borrow_mut ( ) . root_var ( var)
12981298 }
12991299
1300- /// Where possible, replaces type/int/float variables in
1300+ /// Where possible, replaces type/const variables in
13011301 /// `value` with their final value. Note that region variables
1302- /// are unaffected. If a type variable has not been unified, it
1302+ /// are unaffected. If a type/const variable has not been unified, it
13031303 /// is left as is. This is an idempotent operation that does
13041304 /// not affect inference state in any way and so you can do it
13051305 /// at will.
1306- pub fn resolve_type_vars_if_possible < T > ( & self , value : & T ) -> T
1306+ pub fn resolve_vars_if_possible < T > ( & self , value : & T ) -> T
13071307 where
13081308 T : TypeFoldable < ' tcx > ,
13091309 {
13101310 if !value. needs_infer ( ) {
13111311 return value. clone ( ) ; // avoid duplicated subst-folding
13121312 }
1313- let mut r = resolve:: OpportunisticTypeResolver :: new ( self ) ;
1313+ let mut r = resolve:: OpportunisticVarResolver :: new ( self ) ;
13141314 value. fold_with ( & mut r)
13151315 }
13161316
13171317 /// Returns first unresolved variable contained in `T`. In the
13181318 /// process of visiting `T`, this will resolve (where possible)
13191319 /// type variables in `T`, but it never constructs the final,
13201320 /// resolved type, so it's more efficient than
1321- /// `resolve_type_vars_if_possible ()`.
1321+ /// `resolve_vars_if_possible ()`.
13221322 pub fn unresolved_type_vars < T > ( & self , value : & T ) -> Option < ( Ty < ' tcx > , Option < Span > ) >
13231323 where
13241324 T : TypeFoldable < ' tcx > ,
@@ -1389,7 +1389,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
13891389 where
13901390 M : FnOnce ( String ) -> DiagnosticBuilder < ' tcx > ,
13911391 {
1392- let actual_ty = self . resolve_type_vars_if_possible ( & actual_ty) ;
1392+ let actual_ty = self . resolve_vars_if_possible ( & actual_ty) ;
13931393 debug ! ( "type_error_struct_with_diag({:?}, {:?})" , sp, actual_ty) ;
13941394
13951395 // Don't report an error if actual type is `Error`.
@@ -1446,7 +1446,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
14461446 ty : Ty < ' tcx > ,
14471447 span : Span ,
14481448 ) -> bool {
1449- let ty = self . resolve_type_vars_if_possible ( & ty) ;
1449+ let ty = self . resolve_vars_if_possible ( & ty) ;
14501450
14511451 // Even if the type may have no inference variables, during
14521452 // type-checking closure types are in local tables only.
0 commit comments