Skip to content

Commit aa30af5

Browse files
committed
---
yaml --- r: 3755 b: refs/heads/master c: 1ff426b h: refs/heads/master i: 3753: 88287c3 3751: a8ce7f1 v: v3
1 parent 96067d5 commit aa30af5

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 9b7984c25003f2fdde9f56e5d67c6195194549ca
2+
refs/heads/master: 1ff426b89f12dec3cda43fa2d2600675a600a0f0

trunk/src/comp/middle/ty.rs

+24-20
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import std::str;
55
import std::uint;
66
import std::vec;
77
import std::box;
8-
import std::ufind;
8+
import std::ufindivec;
99
import std::map;
1010
import std::map::hashmap;
1111
import std::option;
@@ -1989,31 +1989,31 @@ mod unify {
19891989

19901990
}
19911991
type var_bindings =
1992-
rec(ufind::ufind sets, smallintmap::smallintmap[t] types);
1992+
rec(ufindivec::ufind sets, smallintmap::smallintmap[t] types);
19931993

19941994
type ctxt = rec(@var_bindings vb, ty_ctxt tcx);
19951995

19961996
fn mk_var_bindings() -> @var_bindings {
1997-
ret @rec(sets=ufind::make(), types=smallintmap::mk[t]());
1997+
ret @rec(sets=ufindivec::make(), types=smallintmap::mk[t]());
19981998
}
19991999

20002000
// Unifies two sets.
20012001
fn union(&@ctxt cx, uint set_a, uint set_b) -> union_result {
2002-
ufind::grow(cx.vb.sets, uint::max(set_a, set_b) + 1u);
2003-
auto root_a = ufind::find(cx.vb.sets, set_a);
2004-
auto root_b = ufind::find(cx.vb.sets, set_b);
2002+
ufindivec::grow(cx.vb.sets, uint::max(set_a, set_b) + 1u);
2003+
auto root_a = ufindivec::find(cx.vb.sets, set_a);
2004+
auto root_b = ufindivec::find(cx.vb.sets, set_b);
20052005

20062006
auto replace_type = bind fn (&@ctxt cx, t t, uint set_a, uint set_b) {
2007-
ufind::union(cx.vb.sets, set_a, set_b);
2008-
let uint root_c = ufind::find(cx.vb.sets, set_a);
2007+
ufindivec::union(cx.vb.sets, set_a, set_b);
2008+
let uint root_c = ufindivec::find(cx.vb.sets, set_a);
20092009
smallintmap::insert[t](cx.vb.types, root_c, t);
20102010
} (_, _, set_a, set_b);
20112011

20122012
alt (smallintmap::find(cx.vb.types, root_a)) {
20132013
case (none) {
20142014
alt (smallintmap::find(cx.vb.types, root_b)) {
20152015
case (none) {
2016-
ufind::union(cx.vb.sets, set_a, set_b);
2016+
ufindivec::union(cx.vb.sets, set_a, set_b);
20172017
ret unres_ok; }
20182018
case (some(?t_b)) {
20192019
replace_type(cx, t_b);
@@ -2043,8 +2043,8 @@ mod unify {
20432043
}
20442044
}
20452045
fn record_var_binding(&@ctxt cx, int key, t typ) -> result {
2046-
ufind::grow(cx.vb.sets, (key as uint) + 1u);
2047-
auto root = ufind::find(cx.vb.sets, key as uint);
2046+
ufindivec::grow(cx.vb.sets, (key as uint) + 1u);
2047+
auto root = ufindivec::find(cx.vb.sets, key as uint);
20482048
auto result_type = typ;
20492049
alt (smallintmap::find[t](cx.vb.types, root)) {
20502050
case (some(?old_type)) {
@@ -2229,10 +2229,10 @@ mod unify {
22292229
fixup_result {
22302230
alt (struct(tcx, typ)) {
22312231
case (ty_var(?vid)) {
2232-
if (vid as uint >= ufind::set_count(vb.sets)) {
2232+
if (vid as uint >= ufindivec::set_count(vb.sets)) {
22332233
ret fix_err(vid);
22342234
}
2235-
auto root_id = ufind::find(vb.sets, vid as uint);
2235+
auto root_id = ufindivec::find(vb.sets, vid as uint);
22362236
alt (smallintmap::find[t](vb.types, root_id)) {
22372237
case (none[t]) { ret fix_err(vid); }
22382238
case (some[t](?rt)) { ret fix_ok(rt); }
@@ -2644,11 +2644,13 @@ mod unify {
26442644
}
26452645
fn dump_var_bindings(ty_ctxt tcx, @var_bindings vb) {
26462646
auto i = 0u;
2647-
while (i < vec::len[ufind::node](vb.sets.nodes)) {
2647+
while (i < ivec::len[ufindivec::node](vb.sets.nodes)) {
26482648
auto sets = "";
26492649
auto j = 0u;
2650-
while (j < vec::len[option::t[uint]](vb.sets.nodes)) {
2651-
if (ufind::find(vb.sets, j) == i) { sets += #fmt(" %u", j); }
2650+
while (j < ivec::len[option::t[uint]](vb.sets.nodes)) {
2651+
if (ufindivec::find(vb.sets, j) == i) {
2652+
sets += #fmt(" %u", j);
2653+
}
26522654
j += 1u;
26532655
}
26542656
auto typespec;
@@ -2667,11 +2669,11 @@ mod unify {
26672669
fn fixup_vars(ty_ctxt tcx, @var_bindings vb, t typ) -> fixup_result {
26682670
fn subst_vars(ty_ctxt tcx, @var_bindings vb,
26692671
@mutable option::t[int] unresolved, int vid) -> t {
2670-
if (vid as uint >= ufind::set_count(vb.sets)) {
2672+
if (vid as uint >= ufindivec::set_count(vb.sets)) {
26712673
*unresolved = some[int](vid);
26722674
ret ty::mk_var(tcx, vid);
26732675
}
2674-
auto root_id = ufind::find(vb.sets, vid as uint);
2676+
auto root_id = ufindivec::find(vb.sets, vid as uint);
26752677
alt (smallintmap::find[t](vb.types, root_id)) {
26762678
case (none[t]) {
26772679
*unresolved = some[int](vid);
@@ -2696,8 +2698,10 @@ mod unify {
26962698
}
26972699
fn resolve_type_var(&ty_ctxt tcx, &@var_bindings vb, int vid) ->
26982700
fixup_result {
2699-
if (vid as uint >= ufind::set_count(vb.sets)) { ret fix_err(vid); }
2700-
auto root_id = ufind::find(vb.sets, vid as uint);
2701+
if (vid as uint >= ufindivec::set_count(vb.sets)) {
2702+
ret fix_err(vid);
2703+
}
2704+
auto root_id = ufindivec::find(vb.sets, vid as uint);
27012705
alt (smallintmap::find[t](vb.types, root_id)) {
27022706
case (none[t]) { ret fix_err(vid); }
27032707
case (some[t](?rt)) { ret fixup_vars(tcx, vb, rt); }

trunk/src/comp/middle/typeck.rs

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import middle::ty::unify::fix_err;
3636
import std::int;
3737
import std::ivec;
3838
import std::str;
39-
import std::ufind;
4039
import std::uint;
4140
import std::vec;
4241
import std::map;

0 commit comments

Comments
 (0)