Skip to content

Commit 89aa282

Browse files
committed
rustc: Use fewer boxes in typestate
1 parent 57f399b commit 89aa282

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/rustc/middle/tstate/ann.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ type poststate = t;
3131
*/
3232

3333
/* named thus so as not to confuse with prestate and poststate */
34-
type pre_and_post = @{precondition: precond, postcondition: postcond};
34+
type pre_and_post = {precondition: precond, postcondition: postcond};
3535

3636

3737
/* FIXME: once it's implemented: */
3838

3939
// : ((*.precondition).nbits == (*.postcondition).nbits);
4040
type pre_and_post_state = {prestate: prestate, poststate: poststate};
4141

42-
type ts_ann = @{conditions: pre_and_post, states: pre_and_post_state};
42+
type ts_ann = {conditions: pre_and_post, states: pre_and_post_state};
4343

4444
fn true_precond(num_vars: uint) -> precond { ret create_tritv(num_vars); }
4545

@@ -58,8 +58,8 @@ fn false_postcond(num_vars: uint) -> postcond {
5858
}
5959

6060
fn empty_pre_post(num_vars: uint) -> pre_and_post {
61-
ret @{precondition: empty_prestate(num_vars),
62-
postcondition: empty_poststate(num_vars)};
61+
ret {precondition: empty_prestate(num_vars),
62+
postcondition: empty_poststate(num_vars)};
6363
}
6464

6565
fn empty_states(num_vars: uint) -> pre_and_post_state {
@@ -68,8 +68,8 @@ fn empty_states(num_vars: uint) -> pre_and_post_state {
6868
}
6969

7070
fn empty_ann(num_vars: uint) -> ts_ann {
71-
ret @{conditions: empty_pre_post(num_vars),
72-
states: empty_states(num_vars)};
71+
ret {conditions: empty_pre_post(num_vars),
72+
states: empty_states(num_vars)};
7373
}
7474

7575
fn get_pre(&&p: pre_and_post) -> precond { ret p.precondition; }
@@ -224,8 +224,8 @@ fn ann_prestate(a: ts_ann) -> prestate { ret a.states.prestate; }
224224
fn ann_poststate(a: ts_ann) -> poststate { ret a.states.poststate; }
225225

226226
fn pp_clone(p: pre_and_post) -> pre_and_post {
227-
ret @{precondition: clone(p.precondition),
228-
postcondition: clone(p.postcondition)};
227+
ret {precondition: clone(p.precondition),
228+
postcondition: clone(p.postcondition)};
229229
}
230230

231231
fn clone(p: prestate) -> prestate { ret tritv_clone(p); }

src/rustc/middle/tstate/bitvectors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ fn seq_preconds(fcx: fn_ctxt, pps: [pre_and_post]) -> precond {
8080
let next_first_post = clone(first.postcondition);
8181
seq_tritv(next_first_post, second.postcondition);
8282
idx += 1u;
83-
first = @{precondition: next_first,
84-
postcondition: next_first_post};
83+
first = {precondition: next_first,
84+
postcondition: next_first_post};
8585
} else { ret first.precondition; }
8686
}
8787
}

src/rustc/middle/tstate/pre_post_conditions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ fn find_pre_post_expr(fcx: fn_ctxt, e: @expr) {
413413
}
414414
let antec_pp = pp_clone(expr_pp(fcx.ccx, ex));
415415
let e_pp =
416-
@{precondition: empty_prestate(num_local_vars),
417-
postcondition: false_postcond(num_local_vars)};
416+
{precondition: empty_prestate(num_local_vars),
417+
postcondition: false_postcond(num_local_vars)};
418418
let g = bind combine_pp(antec_pp, fcx, _, _);
419419
let alts_overall_pp =
420420
vec::foldl(e_pp, alt_pps, g);

0 commit comments

Comments
 (0)