Skip to content

Commit 577a84f

Browse files
committed
---
yaml --- r: 7001 b: refs/heads/master c: 8c14943 h: refs/heads/master i: 6999: e3b4084 v: v3
1 parent c5fed4f commit 577a84f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 86279e86930704efc580097bfaf53c4fca6d78b2
2+
refs/heads/master: 8c14943dead216ce62b9197a6030dad8e2047428

trunk/src/comp/middle/kind.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ fn check_crate(tcx: ty::ctxt, method_map: typeck::method_map,
4444
let visit = visit::mk_vt(@{
4545
visit_expr: check_expr,
4646
visit_stmt: check_stmt,
47+
visit_block: check_block,
4748
visit_fn: check_fn
4849
with *visit::default_visitor()
4950
});
@@ -117,12 +118,18 @@ fn check_fn_cap_clause(cx: ctx,
117118
}
118119
}
119120

120-
fn check_expr(e: @expr, cx: ctx, v: visit::vt<ctx>) {
121+
fn check_block(b: blk, cx: ctx, v: visit::vt<ctx>) {
122+
alt b.node.expr {
123+
some(ex) { maybe_copy(cx, ex); }
124+
_ {}
125+
}
126+
visit::visit_block(b, cx, v);
127+
}
121128

129+
fn check_expr(e: @expr, cx: ctx, v: visit::vt<ctx>) {
122130
alt e.node {
123131
expr_assign(_, ex) | expr_assign_op(_, _, ex) |
124-
expr_block({node: {expr: some(ex), _}, _}) |
125-
expr_unary(box(_), ex) | expr_unary(uniq(_), ex) { maybe_copy(cx, ex); }
132+
expr_unary(box(_), ex) | expr_unary(uniq(_), ex) |
126133
expr_ret(some(ex)) { maybe_copy(cx, ex); }
127134
expr_copy(expr) { check_copy_ex(cx, expr, false); }
128135
// Vector add copies.

0 commit comments

Comments
 (0)