Skip to content

Commit a9979c0

Browse files
committed
switch over some newtyped enums to structs
1 parent 6d2bef5 commit a9979c0

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

src/rustc/middle/typeck/infer.rs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -291,16 +291,16 @@ enum var_value<V:copy, T:copy> {
291291
root(T, uint),
292292
}
293293

294-
type vals_and_bindings<V:copy, T:copy> = {
295-
vals: smallintmap<var_value<V, T>>,
296-
mut bindings: ~[(V, var_value<V, T>)]
297-
};
294+
struct vals_and_bindings<V:copy, T:copy> {
295+
vals: smallintmap<var_value<V, T>>;
296+
mut bindings: ~[(V, var_value<V, T>)];
297+
}
298298

299-
enum node<V:copy, T:copy> = {
300-
root: V,
301-
possible_types: T,
302-
rank: uint,
303-
};
299+
struct node<V:copy, T:copy> {
300+
root: V;
301+
possible_types: T;
302+
rank: uint;
303+
}
304304

305305
enum infer_ctxt = @{
306306
tcx: ty::ctxt,
@@ -353,7 +353,10 @@ type ures = result::result<(), ty::type_err>;
353353
type fres<T> = result::result<T, fixup_err>;
354354

355355
fn new_vals_and_bindings<V:copy, T:copy>() -> vals_and_bindings<V, T> {
356-
{vals: smallintmap::mk(), mut bindings: ~[]}
356+
vals_and_bindings {
357+
vals: smallintmap::mk(),
358+
mut bindings: ~[]
359+
}
357360
}
358361

359362
fn new_infer_ctxt(tcx: ty::ctxt) -> infer_ctxt {
@@ -727,15 +730,15 @@ impl infer_ctxt {
727730
some(var_val) => {
728731
match var_val {
729732
redirect(vid) => {
730-
let nde = self.get(vb, vid);
731-
if nde.root != vid {
733+
let node = self.get(vb, vid);
734+
if node.root != vid {
732735
// Path compression
733-
vb.vals.insert(vid.to_uint(), redirect(nde.root));
736+
vb.vals.insert(vid.to_uint(), redirect(node.root));
734737
}
735-
nde
738+
node
736739
}
737740
root(pt, rk) => {
738-
node({root: vid, possible_types: pt, rank: rk})
741+
node {root: vid, possible_types: pt, rank: rk}
739742
}
740743
}
741744
}

0 commit comments

Comments
 (0)