From 3009574165ca607d1d12bd9a557f06776f69927a Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 9 Jun 2011 13:55:56 -0700 Subject: [PATCH] rustc: Unify with the root types --- src/comp/middle/ty.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index 6901d30b5092..399113d437ad 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -1810,9 +1810,10 @@ mod unify { fn record_var_binding(&@ctxt cx, int key, t typ) -> result { ufind::grow(cx.vb.sets, (key as uint) + 1u); + auto root = ufind::find(cx.vb.sets, key as uint); auto result_type = typ; - alt (smallintmap::find[t](cx.vb.types, key as uint)) { + alt (smallintmap::find[t](cx.vb.types, root)) { case (some(?old_type)) { alt (unify_step(cx, old_type, typ)) { case (ures_ok(?unified_type)) { @@ -1824,7 +1825,7 @@ mod unify { case (none) { /* fall through */ } } - smallintmap::insert[t](cx.vb.types, key as uint, result_type); + smallintmap::insert[t](cx.vb.types, root, result_type); ret ures_ok(typ); }