Skip to content

Commit 32282ce

Browse files
committed
---
yaml --- r: 2981 b: refs/heads/master c: cc7a8b6 h: refs/heads/master i: 2979: 5b1dc87 v: v3
1 parent bdea8d9 commit 32282ce

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 7527084e629340503fbe15b8e21c73879b5bd253
2+
refs/heads/master: cc7a8b668f62d1e667d070759bfb7b57b284f0cb

trunk/src/comp/middle/ty.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,38 +2099,31 @@ mod unify {
20992099
// we eliminate pushdown. The typechecker should never rely on early
21002100
// resolution of type variables.
21012101
fn resolve_all_vars(&ty_ctxt tcx, &@var_bindings vb, t typ) -> t {
2102-
fn folder(ty_ctxt tcx, @var_bindings vb, @bool success, t typ) -> t {
2102+
if (!type_contains_vars(tcx, typ)) { ret typ; }
2103+
2104+
fn folder(ty_ctxt tcx, @var_bindings vb, t typ) -> t {
21032105
alt (struct(tcx, typ)) {
21042106
case (ty_var(?vid)) {
21052107
// It's possible that we haven't even created the var set.
21062108
// Handle this case gracefully.
21072109
if ((vid as uint) >= ufind::set_count(vb.sets)) {
2108-
*success = false; ret typ;
2110+
ret typ;
21092111
}
21102112

21112113
auto root_id = ufind::find(vb.sets, vid as uint);
21122114
alt (smallintmap::find[t](vb.types, root_id)) {
21132115
case (some[t](?typ2)) {
2114-
ret fold_ty(tcx, bind folder(tcx, vb, success, _),
2115-
typ2);
2116+
ret fold_ty(tcx, bind folder(tcx, vb, _), typ2);
21162117
}
2117-
case (none[t]) { *success = false; ret typ; }
2118+
case (none[t]) { ret typ; }
21182119
}
2119-
log ""; // fixes ambiguity
2120-
*success = false; ret typ;
21212120
}
21222121

21232122
case (_) { ret typ; }
21242123
}
21252124
}
21262125

2127-
auto success = @true;
2128-
auto rty = fold_ty(tcx, bind folder(tcx, vb, success, _), typ);
2129-
/*if (*success) { ret rty; }
2130-
log_err "*** failed! type " + ty::ty_to_str(tcx, typ) + " => " +
2131-
ty::ty_to_str(tcx, rty);
2132-
ret typ;*/
2133-
ret rty;
2126+
ret fold_ty(tcx, bind folder(tcx, vb, _), typ);
21342127
}
21352128

21362129
fn unify_step(&@ctxt cx, &t expected, &t actual) -> result {

0 commit comments

Comments
 (0)