diff options
| author | Austin Seipp <as@hacks.yi.org> | 2012-01-09 19:15:17 -0600 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-01-09 19:27:05 -0800 |
| commit | a94b1ccacbc2869b6a67afcda98d7495c0086eb3 (patch) | |
| tree | 46c25968d972b54ef5acb86a7c18ed1bcf541f3e /src/comp/middle | |
| parent | aeae04cb49a3af321e75f839d409768014bd5169 (diff) | |
| download | rust-a94b1ccacbc2869b6a67afcda98d7495c0086eb3.tar.gz rust-a94b1ccacbc2869b6a67afcda98d7495c0086eb3.zip | |
Change all uses of 'when' in alt-patterns to 'if'
Issue #1396
Diffstat (limited to 'src/comp/middle')
| -rw-r--r-- | src/comp/middle/last_use.rs | 2 | ||||
| -rw-r--r-- | src/comp/middle/trans.rs | 2 | ||||
| -rw-r--r-- | src/comp/middle/ty.rs | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/comp/middle/last_use.rs b/src/comp/middle/last_use.rs index 075c40ccfa5..5c9e298bcfb 100644 --- a/src/comp/middle/last_use.rs +++ b/src/comp/middle/last_use.rs @@ -153,7 +153,7 @@ fn visit_expr(ex: @expr, cx: ctx, v: visit::vt<ctx>) { for arg in args { alt arg.node { expr_fn(proto_block., _, _, _) { fns += [arg]; } - expr_fn_block(_, _) when is_block(cx, arg.id) { fns += [arg]; } + expr_fn_block(_, _) if is_block(cx, arg.id) { fns += [arg]; } _ { alt arg_ts[i].mode { by_mut_ref. { clear_if_path(cx, arg, v, false); } diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 108f2c5b1c5..c884daacf58 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -1341,7 +1341,7 @@ fn make_take_glue(cx: @block_ctxt, v: ValueRef, t: ty::t) { ty::ty_opaque_closure_ptr(ck) { trans_closure::make_opaque_cbox_take_glue(bcx, ck, v) } - _ when ty::type_is_structural(bcx_tcx(bcx), t) { + _ if ty::type_is_structural(bcx_tcx(bcx), t) { iter_structural_ty(bcx, v, t, take_ty) } _ { bcx } diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index f1a1858267a..e0c6d6f4ba2 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -1953,9 +1953,9 @@ mod unify { } ret alt variance { - invariant. when e_proto == a_proto { none } - covariant. when sub_proto(a_proto, e_proto) { none } - contravariant. when sub_proto(e_proto, a_proto) { none } + invariant. if e_proto == a_proto { none } + covariant. if sub_proto(a_proto, e_proto) { none } + contravariant. if sub_proto(e_proto, a_proto) { none } _ { some(ures_err(terr_mismatch)) } }; } @@ -2220,7 +2220,7 @@ mod unify { } ty::ty_param(expected_n, _) { alt struct(cx.tcx, actual) { - ty::ty_param(actual_n, _) when expected_n == actual_n { + ty::ty_param(actual_n, _) if expected_n == actual_n { ret ures_ok(expected); } _ { ret ures_err(terr_mismatch); } |
