Skip to content

Commit 978d36e

Browse files
committed
---
yaml --- r: 28027 b: refs/heads/try c: 37bcd67 h: refs/heads/master i: 28025: 1f40b57 28023: 45b1908 v: v3
1 parent f120883 commit 978d36e

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
5-
refs/heads/try: e47d2f60607142eaf68a0c560f5c3d37fd1da13d
5+
refs/heads/try: 37bcd67a0956e0d3264abef08027f9d70d3b362e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df

branches/try/src/rustc/middle/kind.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ fn check_crate(tcx: ty::ctxt,
7474
last_use_map: last_use_map,
7575
current_item: -1};
7676
let visit = visit::mk_vt(@{
77+
visit_arm: check_arm,
7778
visit_expr: check_expr,
7879
visit_stmt: check_stmt,
7980
visit_block: check_block,
@@ -225,6 +226,19 @@ fn check_block(b: blk, cx: ctx, v: visit::vt<ctx>) {
225226
visit::visit_block(b, cx, v);
226227
}
227228

229+
fn check_arm(a: arm, cx: ctx, v: visit::vt<ctx>) {
230+
for vec::each(a.pats) |p| {
231+
do pat_util::pat_bindings(cx.tcx.def_map, p) |mode, id, span, _path| {
232+
if mode == bind_by_value {
233+
let t = ty::node_id_to_type(cx.tcx, id);
234+
let reason = "consider binding with `ref` or `move` instead";
235+
check_copy(cx, id, t, span, false, some((reason,reason)));
236+
}
237+
}
238+
}
239+
visit::visit_arm(a, cx, v);
240+
}
241+
228242
fn check_expr(e: @expr, cx: ctx, v: visit::vt<ctx>) {
229243
debug!("kind::check_expr(%s)", expr_to_str(e, cx.tcx.sess.intr()));
230244

branches/try/src/test/run-pass/pipe-presentation-examples.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ macro_rules! select_if (
2323
} => {
2424
if $index == $count {
2525
match move pipes::try_recv($port) {
26-
$(some($message($($(copy $x,)+)* next)) => {
27-
// FIXME (#2329) we really want move out of enum here.
26+
$(some($message($($(move $x,)+)* next)) => {
2827
let $next = unsafe { let x <- *ptr::addr_of(next); x };
2928
$e
3029
})+

0 commit comments

Comments
 (0)