rustc: Remove all calls to resolve_all_vars and the function itself

This commit is contained in:
Patrick Walton 2011-06-09 14:17:50 -07:00
parent 06d706e197
commit c7ca08d1b6
2 changed files with 1 additions and 27 deletions

View File

@ -2041,31 +2041,6 @@ fn unify_obj(&@ctxt cx,
ret ures_ok(t);
}
// FIXME: This function should not be necessary, but it is for now until
// we eliminate pushdown. The typechecker should never rely on early
// resolution of type variables.
fn resolve_all_vars(&ty_ctxt tcx, &@var_bindings vb, t typ) -> t {
if (!type_contains_vars(tcx, typ)) { ret typ; }
fn folder(ty_ctxt tcx, @var_bindings vb, int vid) -> t {
// It's possible that we haven't even created the var set.
// Handle this case gracefully.
if ((vid as uint) >= ufind::set_count(vb.sets)) {
ret ty::mk_var(tcx, vid);
}
auto root_id = ufind::find(vb.sets, vid as uint);
alt (smallintmap::find[t](vb.types, root_id)) {
case (some[t](?typ2)) {
ret fold_ty(tcx, fm_var(bind folder(tcx, vb, _)), typ2);
}
case (none[t]) { ret ty::mk_var(tcx, vid); }
}
}
ret fold_ty(tcx, fm_var(bind folder(tcx, vb, _)), typ);
}
// If the given type is a variable, returns the structure of that type.
fn resolve_type_structure(&ty_ctxt tcx, &@var_bindings vb, t typ)
-> fixup_result {

View File

@ -935,8 +935,7 @@ fn full(&@fn_ctxt fcx, &span sp, &ty::t expected, &ty::t actual,
case (ures_ok(?t)) {
let vec[ty::t] result_ty_param_substs = [];
for (int var_id in ty_param_subst_var_ids) {
auto tp_subst = ty::unify::resolve_all_vars(fcx.ccx.tcx,
fcx.var_bindings, ty::mk_var(fcx.ccx.tcx, var_id));
auto tp_subst = ty::mk_var(fcx.ccx.tcx, var_id);
result_ty_param_substs += [tp_subst];
}