Skip to content

Commit 7003c3c

Browse files
committed
---
yaml --- r: 4721 b: refs/heads/master c: 38c2363 h: refs/heads/master i: 4719: 03827ba v: v3
1 parent 7b07d38 commit 7003c3c

File tree

5 files changed

+27
-80
lines changed

5 files changed

+27
-80
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: df402a5029a1e37d8fbf7f5a18d32efaf9ef751b
2+
refs/heads/master: 38c2363c459b481f40392f78b4db843172961fd4

trunk/src/comp/middle/ty.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import std::ivec;
33
import std::str;
44
import std::uint;
55
import std::box;
6-
import std::ufindivec;
6+
import std::ufind;
77
import std::map;
88
import std::map::hashmap;
99
import std::option;
@@ -2130,24 +2130,24 @@ mod unify {
21302130

21312131
}
21322132
type var_bindings =
2133-
{sets: ufindivec::ufind, types: smallintmap::smallintmap[t]};
2133+
{sets: ufind::ufind, types: smallintmap::smallintmap[t]};
21342134

21352135
type ctxt = {vb: @var_bindings, tcx: ty_ctxt};
21362136

21372137
fn mk_var_bindings() -> @var_bindings {
2138-
ret @{sets: ufindivec::make(), types: smallintmap::mk[t]()};
2138+
ret @{sets: ufind::make(), types: smallintmap::mk[t]()};
21392139
}
21402140

21412141
// Unifies two sets.
21422142
fn union(cx: &@ctxt, set_a: uint, set_b: uint) -> union_result {
2143-
ufindivec::grow(cx.vb.sets, uint::max(set_a, set_b) + 1u);
2144-
let root_a = ufindivec::find(cx.vb.sets, set_a);
2145-
let root_b = ufindivec::find(cx.vb.sets, set_b);
2143+
ufind::grow(cx.vb.sets, uint::max(set_a, set_b) + 1u);
2144+
let root_a = ufind::find(cx.vb.sets, set_a);
2145+
let root_b = ufind::find(cx.vb.sets, set_b);
21462146

21472147
let replace_type =
21482148
bind fn (cx: &@ctxt, t: t, set_a: uint, set_b: uint) {
2149-
ufindivec::union(cx.vb.sets, set_a, set_b);
2150-
let root_c: uint = ufindivec::find(cx.vb.sets, set_a);
2149+
ufind::union(cx.vb.sets, set_a, set_b);
2150+
let root_c: uint = ufind::find(cx.vb.sets, set_a);
21512151
smallintmap::insert[t](cx.vb.types, root_c, t);
21522152
}(_, _, set_a, set_b);
21532153

@@ -2156,7 +2156,7 @@ mod unify {
21562156
none. {
21572157
alt smallintmap::find(cx.vb.types, root_b) {
21582158
none. {
2159-
ufindivec::union(cx.vb.sets, set_a, set_b);
2159+
ufind::union(cx.vb.sets, set_a, set_b);
21602160
ret unres_ok;
21612161
}
21622162
some(t_b) { replace_type(cx, t_b); ret unres_ok; }
@@ -2176,8 +2176,8 @@ mod unify {
21762176
}
21772177
}
21782178
fn record_var_binding(cx: &@ctxt, key: int, typ: t) -> result {
2179-
ufindivec::grow(cx.vb.sets, (key as uint) + 1u);
2180-
let root = ufindivec::find(cx.vb.sets, key as uint);
2179+
ufind::grow(cx.vb.sets, (key as uint) + 1u);
2180+
let root = ufind::find(cx.vb.sets, key as uint);
21812181
let result_type = typ;
21822182
alt smallintmap::find[t](cx.vb.types, root) {
21832183
some(old_type) {
@@ -2410,10 +2410,10 @@ mod unify {
24102410
fixup_result {
24112411
alt struct(tcx, typ) {
24122412
ty_var(vid) {
2413-
if vid as uint >= ufindivec::set_count(vb.sets) {
2413+
if vid as uint >= ufind::set_count(vb.sets) {
24142414
ret fix_err(vid);
24152415
}
2416-
let root_id = ufindivec::find(vb.sets, vid as uint);
2416+
let root_id = ufind::find(vb.sets, vid as uint);
24172417
alt smallintmap::find[t](vb.types, root_id) {
24182418
none. { ret fix_err(vid); }
24192419
some(rt) { ret fix_ok(rt); }
@@ -2825,11 +2825,11 @@ mod unify {
28252825
}
28262826
fn dump_var_bindings(tcx: ty_ctxt, vb: @var_bindings) {
28272827
let i = 0u;
2828-
while i < ivec::len[ufindivec::node](vb.sets.nodes) {
2828+
while i < ivec::len[ufind::node](vb.sets.nodes) {
28292829
let sets = "";
28302830
let j = 0u;
28312831
while j < ivec::len[option::t[uint]](vb.sets.nodes) {
2832-
if ufindivec::find(vb.sets, j) == i {
2832+
if ufind::find(vb.sets, j) == i {
28332833
sets += #fmt(" %u", j);
28342834
}
28352835
j += 1u;
@@ -2854,11 +2854,11 @@ mod unify {
28542854
unresolved: @mutable option::t[int], vid: int) -> t {
28552855
// Should really return a fixup_result instead of a t, but fold_ty
28562856
// doesn't allow returning anything but a t.
2857-
if vid as uint >= ufindivec::set_count(vb.sets) {
2857+
if vid as uint >= ufind::set_count(vb.sets) {
28582858
*unresolved = some(vid);
28592859
ret ty::mk_var(tcx, vid);
28602860
}
2861-
let root_id = ufindivec::find(vb.sets, vid as uint);
2861+
let root_id = ufind::find(vb.sets, vid as uint);
28622862
alt smallintmap::find[t](vb.types, root_id) {
28632863
none. { *unresolved = some(vid); ret ty::mk_var(tcx, vid); }
28642864
some(rt) {
@@ -2884,8 +2884,8 @@ mod unify {
28842884
fn resolve_type_var(tcx: &ty_ctxt, sp: &option::t[span],
28852885
vb: &@var_bindings, vid: int) ->
28862886
fixup_result {
2887-
if vid as uint >= ufindivec::set_count(vb.sets) { ret fix_err(vid); }
2888-
let root_id = ufindivec::find(vb.sets, vid as uint);
2887+
if vid as uint >= ufind::set_count(vb.sets) { ret fix_err(vid); }
2888+
let root_id = ufind::find(vb.sets, vid as uint);
28892889
alt smallintmap::find[t](vb.types, root_id) {
28902890
none. { ret fix_err(vid); }
28912891
some(rt) { ret fixup_vars(tcx, sp, vb, rt); }

trunk/src/lib/std.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ mod sort;
8383
mod sha1;
8484
mod ebml;
8585
mod ufind;
86-
mod ufindivec;
8786
mod extfmt;
8887
mod box;
8988
mod getopts;

trunk/src/lib/ufind.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import option::some;
88
// than the node itself.
99
type node = option::t[uint];
1010

11-
type ufind = {nodes: @mutable [mutable node]};
11+
type ufind = {mutable nodes: [mutable node]};
1212

13-
fn make() -> ufind { ret {nodes: @mutable ~[mutable]}; }
13+
fn make() -> ufind { ret {mutable nodes: ~[mutable]}; }
1414

1515
fn make_set(ufnd: &ufind) -> uint {
16-
let idx = ivec::len(*ufnd.nodes);
17-
*ufnd.nodes += ~[mutable none[uint]];
16+
let idx = ivec::len(ufnd.nodes);
17+
ufnd.nodes += ~[mutable none[uint]];
1818
ret idx;
1919
}
2020

@@ -40,13 +40,13 @@ fn union(ufnd: &ufind, m: uint, n: uint) {
4040
} else if (m_root > n_root) { ufnd.nodes.(m_root) = some[uint](n_root); }
4141
}
4242

43-
fn set_count(ufnd: &ufind) -> uint { ret ivec::len[node](*ufnd.nodes); }
43+
fn set_count(ufnd: &ufind) -> uint { ret ivec::len[node](ufnd.nodes); }
4444

4545

4646
// Removes all sets with IDs greater than or equal to the given value.
4747
fn prune(ufnd: &ufind, n: uint) {
4848
// TODO: Use "slice" once we get rid of "mutable?"
4949

50-
let len = ivec::len[node](*ufnd.nodes);
51-
while len != n { ivec::pop[node](*ufnd.nodes); len -= 1u; }
50+
let len = ivec::len[node](ufnd.nodes);
51+
while len != n { ivec::pop[node](ufnd.nodes); len -= 1u; }
5252
}

trunk/src/lib/ufindivec.rs

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)