@@ -1174,7 +1174,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1174
1174
/// Process the region constraints and report any errors that
1175
1175
/// result. After this, no more unification operations should be
1176
1176
/// 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`.
1178
1178
pub fn resolve_regions_and_report_errors (
1179
1179
& self ,
1180
1180
region_context : DefId ,
@@ -1262,7 +1262,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1262
1262
}
1263
1263
1264
1264
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 ( )
1266
1266
}
1267
1267
1268
1268
pub fn tys_to_string ( & self , ts : & [ Ty < ' tcx > ] ) -> String {
@@ -1271,7 +1271,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1271
1271
}
1272
1272
1273
1273
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 ( )
1275
1275
}
1276
1276
1277
1277
/// 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> {
1297
1297
self . type_variables . borrow_mut ( ) . root_var ( var)
1298
1298
}
1299
1299
1300
- /// Where possible, replaces type/int/float variables in
1300
+ /// Where possible, replaces type/const variables in
1301
1301
/// `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
1303
1303
/// is left as is. This is an idempotent operation that does
1304
1304
/// not affect inference state in any way and so you can do it
1305
1305
/// 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
1307
1307
where
1308
1308
T : TypeFoldable < ' tcx > ,
1309
1309
{
1310
1310
if !value. needs_infer ( ) {
1311
1311
return value. clone ( ) ; // avoid duplicated subst-folding
1312
1312
}
1313
- let mut r = resolve:: OpportunisticTypeResolver :: new ( self ) ;
1313
+ let mut r = resolve:: OpportunisticVarResolver :: new ( self ) ;
1314
1314
value. fold_with ( & mut r)
1315
1315
}
1316
1316
1317
1317
/// Returns first unresolved variable contained in `T`. In the
1318
1318
/// process of visiting `T`, this will resolve (where possible)
1319
1319
/// type variables in `T`, but it never constructs the final,
1320
1320
/// resolved type, so it's more efficient than
1321
- /// `resolve_type_vars_if_possible ()`.
1321
+ /// `resolve_vars_if_possible ()`.
1322
1322
pub fn unresolved_type_vars < T > ( & self , value : & T ) -> Option < ( Ty < ' tcx > , Option < Span > ) >
1323
1323
where
1324
1324
T : TypeFoldable < ' tcx > ,
@@ -1389,7 +1389,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1389
1389
where
1390
1390
M : FnOnce ( String ) -> DiagnosticBuilder < ' tcx > ,
1391
1391
{
1392
- let actual_ty = self . resolve_type_vars_if_possible ( & actual_ty) ;
1392
+ let actual_ty = self . resolve_vars_if_possible ( & actual_ty) ;
1393
1393
debug ! ( "type_error_struct_with_diag({:?}, {:?})" , sp, actual_ty) ;
1394
1394
1395
1395
// Don't report an error if actual type is `Error`.
@@ -1446,7 +1446,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1446
1446
ty : Ty < ' tcx > ,
1447
1447
span : Span ,
1448
1448
) -> bool {
1449
- let ty = self . resolve_type_vars_if_possible ( & ty) ;
1449
+ let ty = self . resolve_vars_if_possible ( & ty) ;
1450
1450
1451
1451
// Even if the type may have no inference variables, during
1452
1452
// type-checking closure types are in local tables only.
0 commit comments