Skip to content

Commit c7ca08d

Browse files
committed
rustc: Remove all calls to resolve_all_vars and the function itself
1 parent 06d706e commit c7ca08d

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

src/comp/middle/ty.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,31 +2041,6 @@ mod unify {
20412041
ret ures_ok(t);
20422042
}
20432043

2044-
// FIXME: This function should not be necessary, but it is for now until
2045-
// we eliminate pushdown. The typechecker should never rely on early
2046-
// resolution of type variables.
2047-
fn resolve_all_vars(&ty_ctxt tcx, &@var_bindings vb, t typ) -> t {
2048-
if (!type_contains_vars(tcx, typ)) { ret typ; }
2049-
2050-
fn folder(ty_ctxt tcx, @var_bindings vb, int vid) -> t {
2051-
// It's possible that we haven't even created the var set.
2052-
// Handle this case gracefully.
2053-
if ((vid as uint) >= ufind::set_count(vb.sets)) {
2054-
ret ty::mk_var(tcx, vid);
2055-
}
2056-
2057-
auto root_id = ufind::find(vb.sets, vid as uint);
2058-
alt (smallintmap::find[t](vb.types, root_id)) {
2059-
case (some[t](?typ2)) {
2060-
ret fold_ty(tcx, fm_var(bind folder(tcx, vb, _)), typ2);
2061-
}
2062-
case (none[t]) { ret ty::mk_var(tcx, vid); }
2063-
}
2064-
}
2065-
2066-
ret fold_ty(tcx, fm_var(bind folder(tcx, vb, _)), typ);
2067-
}
2068-
20692044
// If the given type is a variable, returns the structure of that type.
20702045
fn resolve_type_structure(&ty_ctxt tcx, &@var_bindings vb, t typ)
20712046
-> fixup_result {

src/comp/middle/typeck.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,7 @@ mod demand {
935935
case (ures_ok(?t)) {
936936
let vec[ty::t] result_ty_param_substs = [];
937937
for (int var_id in ty_param_subst_var_ids) {
938-
auto tp_subst = ty::unify::resolve_all_vars(fcx.ccx.tcx,
939-
fcx.var_bindings, ty::mk_var(fcx.ccx.tcx, var_id));
938+
auto tp_subst = ty::mk_var(fcx.ccx.tcx, var_id);
940939
result_ty_param_substs += [tp_subst];
941940
}
942941

0 commit comments

Comments
 (0)