Skip to content

Commit f4557cd

Browse files
committed
---
yaml --- r: 13110 b: refs/heads/master c: f49b891 h: refs/heads/master v: v3
1 parent 154dae1 commit f4557cd

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 6abddca18b432d37945bd2fda24bbc77fba970aa
2+
refs/heads/master: f49b891ce534101695bb012982cf50d21665feef
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/librustsyntax/fold.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,12 +427,17 @@ fn noop_fold_expr(e: expr_, fld: ast_fold) -> expr_ {
427427
expr_alt(fld.fold_expr(expr), vec::map(arms, fld.fold_arm), mode)
428428
}
429429
expr_fn(proto, decl, body, captures) {
430-
expr_fn(proto, fold_fn_decl(decl, fld),
431-
fld.fold_block(body), captures)
430+
expr_fn(proto, fold_fn_decl(decl, fld),
431+
fld.fold_block(body),
432+
@((*captures).map({|cap_item|
433+
@({id: fld.new_id((*cap_item).id)
434+
with *cap_item})})))
432435
}
433436
expr_fn_block(decl, body, captures) {
434437
expr_fn_block(fold_fn_decl(decl, fld), fld.fold_block(body),
435-
captures)
438+
@((*captures).map({|cap_item|
439+
@({id: fld.new_id((*cap_item).id)
440+
with *cap_item})})))
436441
}
437442
expr_block(blk) { expr_block(fld.fold_block(blk)) }
438443
expr_move(el, er) {

trunk/src/rustc/middle/astencode.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ fn visit_ids(item: ast::inlined_item, vfn: fn@(ast::node_id)) {
252252
vfn(m.self_id);
253253
vec::iter(tps) {|tp| vfn(tp.id)}
254254
}
255-
visit::fk_anon(*) | visit::fk_fn_block(*) {
255+
visit::fk_anon(_, capture_clause)
256+
| visit::fk_fn_block(capture_clause) {
257+
for vec::each(*capture_clause) {|clause|
258+
vfn(clause.id);
259+
}
256260
}
257261
}
258262

trunk/src/rustc/middle/capture.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ fn compute_capture_vars(tcx: ty::ctxt,
6767
// first add entries for anything explicitly named in the cap clause
6868

6969
for (*cap_clause).each { |cap_item|
70+
#debug("Doing capture var: %s (%?)",
71+
cap_item.name, cap_item.id);
72+
7073
let cap_def = tcx.def_map.get(cap_item.id);
7174
let cap_def_id = ast_util::def_id_of_def(cap_def).node;
7275
if cap_item.is_move {

trunk/src/test/bench/graph500-bfs.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// xfail-test :(
2-
31
/**
42
53
An implementation of the Graph500 Bread First Search problem in Rust.
@@ -267,8 +265,7 @@ fn pbfs(graph: graph, key: node_id) -> bfs_result {
267265
}
268266
}
269267

270-
let graph_arc = arc::shared_arc(copy graph);
271-
let graph = *graph_arc;
268+
let (res, graph) = arc::shared_arc(copy graph);
272269

273270
let mut i = 0u;
274271
while par::any(colors, is_gray) {
@@ -277,8 +274,7 @@ fn pbfs(graph: graph, key: node_id) -> bfs_result {
277274
i += 1u;
278275
let old_len = colors.len();
279276

280-
let colors_arc = arc::shared_arc(copy colors);
281-
let color = *colors_arc;
277+
let (res, color) = arc::shared_arc(copy colors);
282278

283279
colors = par::mapi(colors) {|i, c|
284280
let c : color = c;

0 commit comments

Comments
 (0)