Skip to content

Commit d2f9b15

Browse files
committed
Rename a field (so that macros can mention it).
1 parent b803326 commit d2f9b15

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

src/comp/middle/trans_alt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ fn trans_alt(cx: &@block_ctxt, expr: &@ast::expr, arms: &[ast::arm],
504504
for a: ast::arm in arms {
505505
let body_cx = bodies.(i);
506506
if make_phi_bindings(body_cx, exit_map, ast::pat_id_map(a.pats.(0))) {
507-
let block_res = trans::trans_block(body_cx, a.block, output);
507+
let block_res = trans::trans_block(body_cx, a.body, output);
508508
arm_results += ~[block_res];
509509
} else { // Unreachable
510510
arm_results += ~[rslt(body_cx, C_nil())];

src/comp/middle/tstate/pre_post_conditions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ fn find_pre_post_expr(fcx: &fn_ctxt, e: @expr) {
504504
expr_alt(ex, alts) {
505505
find_pre_post_expr(fcx, ex);
506506
fn do_an_alt(fcx: &fn_ctxt, an_alt: &arm) -> pre_and_post {
507-
find_pre_post_block(fcx, an_alt.block);
508-
ret block_pp(fcx.ccx, an_alt.block);
507+
find_pre_post_block(fcx, an_alt.body);
508+
ret block_pp(fcx.ccx, an_alt.body);
509509
}
510510
let alt_pps = ~[];
511511
for a: arm in alts { alt_pps += ~[do_an_alt(fcx, a)]; }

src/comp/middle/tstate/states.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,8 @@ fn find_pre_post_state_expr(fcx: &fn_ctxt, pres: &prestate, e: @expr) ->
555555
a_post = false_postcond(num_constrs);
556556
for an_alt: arm in alts {
557557
changed |=
558-
find_pre_post_state_block(fcx, e_post, an_alt.block);
559-
intersect(a_post, block_poststate(fcx.ccx, an_alt.block));
558+
find_pre_post_state_block(fcx, e_post, an_alt.body);
559+
intersect(a_post, block_poststate(fcx.ccx, an_alt.body));
560560
// We deliberately do *not* update changed here, because
561561
// we'd go into an infinite loop that way, and the change
562562
// gets made after the if expression.

src/comp/middle/typeck.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2033,9 +2033,9 @@ fn check_expr_with_unifier(fcx: &@fn_ctxt, expr: &@ast::expr,
20332033
let result_ty = next_ty_var(fcx);
20342034
let arm_non_bot = false;
20352035
for arm: ast::arm in arms {
2036-
if !check_block(fcx, arm.block) { arm_non_bot = true; }
2037-
let bty = block_ty(tcx, arm.block);
2038-
result_ty = demand::simple(fcx, arm.block.span, result_ty, bty);
2036+
if !check_block(fcx, arm.body) { arm_non_bot = true; }
2037+
let bty = block_ty(tcx, arm.body);
2038+
result_ty = demand::simple(fcx, arm.body.span, result_ty, bty);
20392039
}
20402040
bot |= !arm_non_bot;
20412041
if !arm_non_bot { result_ty = ty::mk_bot(tcx); }

src/comp/syntax/ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ type decl = spanned[decl_];
269269
270270
tag decl_ { decl_local([@local]); decl_item(@item); }
271271
272-
type arm = {pats: [@pat], block: blk};
272+
type arm = {pats: [@pat], body: blk};
273273
274274
type field_ = {mut: mutability, ident: ident, expr: @expr};
275275

src/comp/syntax/fold.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ fn noop_fold_stmt(s: &stmt_, fld: ast_fold) -> stmt_ {
268268

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

274274
fn noop_fold_pat(p: &pat_, fld: ast_fold) -> pat_ {

src/comp/syntax/parse/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ fn parse_alt_expr(p: &parser) -> @ast::expr {
13561356
while p.peek() != token::RBRACE {
13571357
let pats = parse_pats(p);
13581358
let blk = parse_block(p);
1359-
arms += ~[{pats: pats, block: blk}];
1359+
arms += ~[{pats: pats, body: blk}];
13601360
}
13611361
let hi = p.get_hi_pos();
13621362
p.bump();

src/comp/syntax/print/pprust.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ fn print_expr(s: &ps, expr: &@ast::expr) {
863863
print_pat(s, p);
864864
}
865865
space(s.s);
866-
print_possibly_embedded_block(s, arm.block, false,
866+
print_possibly_embedded_block(s, arm.body, false,
867867
alt_indent_unit);
868868
}
869869
bclose_(s, expr.span, alt_indent_unit);

src/comp/syntax/visit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ fn visit_expr[E](ex: &@expr, e: &E, v: &vt[E]) {
347347

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

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

0 commit comments

Comments
 (0)