Skip to content

Commit

Permalink
Rename a field (so that macros can mention it).
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstansifer committed Aug 15, 2011
1 parent b803326 commit d2f9b15
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/comp/middle/trans_alt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ fn trans_alt(cx: &@block_ctxt, expr: &@ast::expr, arms: &[ast::arm],
for a: ast::arm in arms {
let body_cx = bodies.(i);
if make_phi_bindings(body_cx, exit_map, ast::pat_id_map(a.pats.(0))) {
let block_res = trans::trans_block(body_cx, a.block, output);
let block_res = trans::trans_block(body_cx, a.body, output);
arm_results += ~[block_res];
} else { // Unreachable
arm_results += ~[rslt(body_cx, C_nil())];
Expand Down
4 changes: 2 additions & 2 deletions src/comp/middle/tstate/pre_post_conditions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ fn find_pre_post_expr(fcx: &fn_ctxt, e: @expr) {
expr_alt(ex, alts) {
find_pre_post_expr(fcx, ex);
fn do_an_alt(fcx: &fn_ctxt, an_alt: &arm) -> pre_and_post {
find_pre_post_block(fcx, an_alt.block);
ret block_pp(fcx.ccx, an_alt.block);
find_pre_post_block(fcx, an_alt.body);
ret block_pp(fcx.ccx, an_alt.body);
}
let alt_pps = ~[];
for a: arm in alts { alt_pps += ~[do_an_alt(fcx, a)]; }
Expand Down
4 changes: 2 additions & 2 deletions src/comp/middle/tstate/states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,8 @@ fn find_pre_post_state_expr(fcx: &fn_ctxt, pres: &prestate, e: @expr) ->
a_post = false_postcond(num_constrs);
for an_alt: arm in alts {
changed |=
find_pre_post_state_block(fcx, e_post, an_alt.block);
intersect(a_post, block_poststate(fcx.ccx, an_alt.block));
find_pre_post_state_block(fcx, e_post, an_alt.body);
intersect(a_post, block_poststate(fcx.ccx, an_alt.body));
// We deliberately do *not* update changed here, because
// we'd go into an infinite loop that way, and the change
// gets made after the if expression.
Expand Down
6 changes: 3 additions & 3 deletions src/comp/middle/typeck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2033,9 +2033,9 @@ fn check_expr_with_unifier(fcx: &@fn_ctxt, expr: &@ast::expr,
let result_ty = next_ty_var(fcx);
let arm_non_bot = false;
for arm: ast::arm in arms {
if !check_block(fcx, arm.block) { arm_non_bot = true; }
let bty = block_ty(tcx, arm.block);
result_ty = demand::simple(fcx, arm.block.span, result_ty, bty);
if !check_block(fcx, arm.body) { arm_non_bot = true; }
let bty = block_ty(tcx, arm.body);
result_ty = demand::simple(fcx, arm.body.span, result_ty, bty);
}
bot |= !arm_non_bot;
if !arm_non_bot { result_ty = ty::mk_bot(tcx); }
Expand Down
2 changes: 1 addition & 1 deletion src/comp/syntax/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ type decl = spanned[decl_];
tag decl_ { decl_local([@local]); decl_item(@item); }
type arm = {pats: [@pat], block: blk};
type arm = {pats: [@pat], body: blk};
type field_ = {mut: mutability, ident: ident, expr: @expr};
Expand Down
2 changes: 1 addition & 1 deletion src/comp/syntax/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ fn noop_fold_stmt(s: &stmt_, fld: ast_fold) -> stmt_ {

fn noop_fold_arm(a: &arm, fld: ast_fold) -> arm {
ret {pats: ivec::map(fld.fold_pat, a.pats),
block: fld.fold_block(a.block)};
body: fld.fold_block(a.body)};
}

fn noop_fold_pat(p: &pat_, fld: ast_fold) -> pat_ {
Expand Down
2 changes: 1 addition & 1 deletion src/comp/syntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ fn parse_alt_expr(p: &parser) -> @ast::expr {
while p.peek() != token::RBRACE {
let pats = parse_pats(p);
let blk = parse_block(p);
arms += ~[{pats: pats, block: blk}];
arms += ~[{pats: pats, body: blk}];
}
let hi = p.get_hi_pos();
p.bump();
Expand Down
2 changes: 1 addition & 1 deletion src/comp/syntax/print/pprust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ fn print_expr(s: &ps, expr: &@ast::expr) {
print_pat(s, p);
}
space(s.s);
print_possibly_embedded_block(s, arm.block, false,
print_possibly_embedded_block(s, arm.body, false,
alt_indent_unit);
}
bclose_(s, expr.span, alt_indent_unit);
Expand Down
2 changes: 1 addition & 1 deletion src/comp/syntax/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ fn visit_expr[E](ex: &@expr, e: &E, v: &vt[E]) {

fn visit_arm[E](a: &arm, e: &E, v: &vt[E]) {
for p: @pat in a.pats { v.visit_pat(p, e, v); }
v.visit_block(a.block, e, v);
v.visit_block(a.body, e, v);
}

// Simpler, non-context passing interface. Always walks the whole tree, simply
Expand Down

0 comments on commit d2f9b15

Please sign in to comment.