Skip to content

Commit 3009574

Browse files
committed
rustc: Unify with the root types
1 parent 3c1be2a commit 3009574

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/comp/middle/ty.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,9 +1810,10 @@ mod unify {
18101810

18111811
fn record_var_binding(&@ctxt cx, int key, t typ) -> result {
18121812
ufind::grow(cx.vb.sets, (key as uint) + 1u);
1813+
auto root = ufind::find(cx.vb.sets, key as uint);
18131814

18141815
auto result_type = typ;
1815-
alt (smallintmap::find[t](cx.vb.types, key as uint)) {
1816+
alt (smallintmap::find[t](cx.vb.types, root)) {
18161817
case (some(?old_type)) {
18171818
alt (unify_step(cx, old_type, typ)) {
18181819
case (ures_ok(?unified_type)) {
@@ -1824,7 +1825,7 @@ mod unify {
18241825
case (none) { /* fall through */ }
18251826
}
18261827

1827-
smallintmap::insert[t](cx.vb.types, key as uint, result_type);
1828+
smallintmap::insert[t](cx.vb.types, root, result_type);
18281829
ret ures_ok(typ);
18291830
}
18301831

0 commit comments

Comments
 (0)