Skip to content

Commit 71478f9

Browse files
committed
Workaround for #4717: pad contents of ast. rs=breakage
1 parent 0682ad0 commit 71478f9

File tree

14 files changed

+22
-17
lines changed

14 files changed

+22
-17
lines changed

src/librustc/front/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ fn mk_test_wrapper(cx: test_ctxt,
510510
let wrapper_expr = ast::expr {
511511
id: cx.sess.next_node_id(),
512512
callee_id: cx.sess.next_node_id(),
513-
node: ast::expr_fn(ast::ProtoBare, wrapper_decl, wrapper_body),
513+
node: ast::expr_fn(ast::ProtoBare, wrapper_decl, wrapper_body, @()),
514514
span: span
515515
};
516516

src/librustc/middle/check_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn check_crate(tcx: ty::ctxt, crate: @crate) {
3232
expr_loop(ref b, _) => {
3333
(v.visit_block)((*b), {in_loop: true,.. cx}, v);
3434
}
35-
expr_fn(_, _, _) => {
35+
expr_fn(*) => {
3636
visit::visit_expr(e, {in_loop: false, can_ret: true}, v);
3737
}
3838
expr_fn_block(_, ref b) => {

src/librustc/middle/freevars.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn collect_freevars(def_map: resolve::DefMap, blk: ast::blk)
4848

4949
let walk_expr = fn@(expr: @ast::expr, &&depth: int, v: visit::vt<int>) {
5050
match expr.node {
51-
ast::expr_fn(proto, _, _) => {
51+
ast::expr_fn(proto, _, _, _) => {
5252
if proto != ast::ProtoBare {
5353
visit::visit_expr(expr, depth + 1, v);
5454
}

src/librustc/middle/liveness.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,8 @@ fn visit_expr(expr: @expr, &&self: @IrMaps, vt: vt<@IrMaps>) {
559559
}
560560
visit::visit_expr(expr, self, vt);
561561
}
562-
expr_fn(_, _, _) |
563-
expr_fn_block(_, _) => {
562+
expr_fn(*) |
563+
expr_fn_block(*) => {
564564
// Interesting control flow (for loops can contain labeled
565565
// breaks or continues)
566566
self.add_live_node_for_node(expr.id, ExprNode(expr.span));
@@ -1105,7 +1105,7 @@ impl Liveness {
11051105
self.propagate_through_expr(e, succ)
11061106
}
11071107

1108-
expr_fn(_, _, ref blk) | expr_fn_block(_, ref blk) => {
1108+
expr_fn(_, _, ref blk, _) | expr_fn_block(_, ref blk) => {
11091109
debug!("%s is an expr_fn or expr_fn_block",
11101110
expr_to_str(expr, self.tcx.sess.intr()));
11111111

src/librustc/middle/moves.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ impl VisitContext {
615615
self.use_expr(base, comp_mode, visitor);
616616
}
617617

618-
expr_fn(_, _, ref body) |
618+
expr_fn(_, _, ref body, _) |
619619
expr_fn_block(_, ref body) => {
620620
let cap_vars = self.compute_captures(expr.id);
621621
self.move_maps.capture_map.insert(expr.id, cap_vars);

src/librustc/middle/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4820,7 +4820,7 @@ pub impl Resolver {
48204820
visit_expr(expr, (), visitor);
48214821
}
48224822

4823-
expr_fn(_, ref fn_decl, ref block) |
4823+
expr_fn(_, ref fn_decl, ref block, _) |
48244824
expr_fn_block(ref fn_decl, ref block) => {
48254825
self.resolve_function(FunctionRibKind(expr.id, block.node.id),
48264826
Some(@/*bad*/copy *fn_decl),

src/librustc/middle/trans/debuginfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ pub fn create_function(fcx: fn_ctxt) -> @metadata<subprogram_md> {
789789
}
790790
ast_map::node_expr(expr) => {
791791
match /*bad*/copy expr.node {
792-
ast::expr_fn(_, decl, _) => {
792+
ast::expr_fn(_, decl, _, _) => {
793793
((dbg_cx.names)(~"fn"), decl.output, expr.id)
794794
}
795795
ast::expr_fn_block(decl, _) => {

src/librustc/middle/trans/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ fn trans_rvalue_dps_unadjusted(bcx: block, expr: @ast::expr,
566566
return tvec::trans_fixed_vstore(bcx, expr, expr, dest);
567567
}
568568
// XXX: Bad copy.
569-
ast::expr_fn(proto, copy decl, ref body) => {
569+
ast::expr_fn(proto, copy decl, ref body, _) => {
570570
// Don't use this function for anything real. Use the one in
571571
// astconv instead.
572572
return closure::trans_expr_fn(bcx, proto, decl,

src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2164,7 +2164,7 @@ pub fn check_expr_with_unifier(fcx: @fn_ctxt,
21642164
ast::expr_match(discrim, ref arms) => {
21652165
bot = _match::check_match(fcx, expr, discrim, (/*bad*/copy *arms));
21662166
}
2167-
ast::expr_fn(proto, ref decl, ref body) => {
2167+
ast::expr_fn(proto, ref decl, ref body, _) => {
21682168
check_expr_fn(fcx, expr, Some(proto),
21692169
decl, (*body), Vanilla, expected);
21702170
}

src/libsyntax/ast.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,10 @@ pub enum expr_ {
695695
(implicit) condition is always true. */
696696
expr_loop(blk, Option<ident>),
697697
expr_match(@expr, ~[arm]),
698-
expr_fn(Proto, fn_decl, blk),
698+
699+
// FIXME(#4717) the @() is req'd on windows or else LLVM croaks
700+
expr_fn(Proto, fn_decl, blk, @()),
701+
699702
expr_fn_block(fn_decl, blk),
700703
// Inner expr is always an expr_fn_block. We need the wrapping node to
701704
// easily type this (a function returning nil on the inside but bool on

src/libsyntax/fold.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,11 @@ pub fn noop_fold_expr(e: expr_, fld: ast_fold) -> expr_ {
466466
expr_match(fld.fold_expr(expr),
467467
vec::map((*arms), |x| fld.fold_arm(*x)))
468468
}
469-
expr_fn(proto, decl, ref body) => {
469+
expr_fn(proto, decl, ref body, _) => {
470470
expr_fn(proto,
471471
fold_fn_decl(decl, fld),
472-
fld.fold_block(*body))
472+
fld.fold_block(*body),
473+
@())
473474
}
474475
expr_fn_block(decl, ref body) => {
475476
expr_fn_block(fold_fn_decl(decl, fld),

src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,8 @@ pub impl Parser {
15671567
let decl = self.parse_fn_decl(|p| p.parse_arg_or_capture_item());
15681568
15691569
let body = self.parse_block();
1570-
return self.mk_expr(lo, body.span.hi,expr_fn(proto, decl, body));
1570+
return self.mk_expr(lo, body.span.hi,
1571+
expr_fn(proto, decl, body, @()));
15711572
}
15721573
15731574
// `|args| { ... }` like in `do` expressions

src/libsyntax/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ pub fn print_expr(s: ps, &&expr: @ast::expr) {
13051305
}
13061306
bclose_(s, expr.span, match_indent_unit);
13071307
}
1308-
ast::expr_fn(proto, decl, ref body) => {
1308+
ast::expr_fn(proto, decl, ref body, _) => {
13091309
// containing cbox, will be closed by print-block at }
13101310
cbox(s, indent_unit);
13111311
// head-box, will be closed by print-block at start

src/libsyntax/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ pub fn visit_expr<E>(ex: @expr, e: E, v: vt<E>) {
457457
(v.visit_expr)(x, e, v);
458458
for (*arms).each |a| { (v.visit_arm)(*a, e, v); }
459459
}
460-
expr_fn(proto, decl, ref body) => {
460+
expr_fn(proto, decl, ref body, _) => {
461461
(v.visit_fn)(fk_anon(proto), decl, (*body),
462462
ex.span, ex.id, e, v);
463463
}

0 commit comments

Comments
 (0)