Skip to content

Commit 9cd3378

Browse files
Austin Seippbrson
authored andcommitted
---
yaml --- r: 7151 b: refs/heads/master c: a94b1cc h: refs/heads/master i: 7149: e07becc 7147: 800ea58 7143: 9cf64e3 7135: bd316ab v: v3
1 parent 02c229c commit 9cd3378

File tree

11 files changed

+18
-18
lines changed

11 files changed

+18
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: aeae04cb49a3af321e75f839d409768014bd5169
2+
refs/heads/master: a94b1ccacbc2869b6a67afcda98d7495c0086eb3

trunk/src/comp/front/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fn fold_item(cx: test_ctxt, &&i: @ast::item, fld: fold::ast_fold) ->
100100

101101
if is_test_fn(i) {
102102
alt i.node {
103-
ast::item_fn(decl, _, _) when decl.purity == ast::unsafe_fn {
103+
ast::item_fn(decl, _, _) if decl.purity == ast::unsafe_fn {
104104
cx.sess.span_fatal(
105105
i.span,
106106
"unsafe functions cannot be used for tests");

trunk/src/comp/middle/last_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ fn visit_expr(ex: @expr, cx: ctx, v: visit::vt<ctx>) {
153153
for arg in args {
154154
alt arg.node {
155155
expr_fn(proto_block., _, _, _) { fns += [arg]; }
156-
expr_fn_block(_, _) when is_block(cx, arg.id) { fns += [arg]; }
156+
expr_fn_block(_, _) if is_block(cx, arg.id) { fns += [arg]; }
157157
_ {
158158
alt arg_ts[i].mode {
159159
by_mut_ref. { clear_if_path(cx, arg, v, false); }

trunk/src/comp/middle/trans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ fn make_take_glue(cx: @block_ctxt, v: ValueRef, t: ty::t) {
13411341
ty::ty_opaque_closure_ptr(ck) {
13421342
trans_closure::make_opaque_cbox_take_glue(bcx, ck, v)
13431343
}
1344-
_ when ty::type_is_structural(bcx_tcx(bcx), t) {
1344+
_ if ty::type_is_structural(bcx_tcx(bcx), t) {
13451345
iter_structural_ty(bcx, v, t, take_ty)
13461346
}
13471347
_ { bcx }

trunk/src/comp/middle/ty.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,9 +1953,9 @@ mod unify {
19531953
}
19541954

19551955
ret alt variance {
1956-
invariant. when e_proto == a_proto { none }
1957-
covariant. when sub_proto(a_proto, e_proto) { none }
1958-
contravariant. when sub_proto(e_proto, a_proto) { none }
1956+
invariant. if e_proto == a_proto { none }
1957+
covariant. if sub_proto(a_proto, e_proto) { none }
1958+
contravariant. if sub_proto(e_proto, a_proto) { none }
19591959
_ { some(ures_err(terr_mismatch)) }
19601960
};
19611961
}
@@ -2220,7 +2220,7 @@ mod unify {
22202220
}
22212221
ty::ty_param(expected_n, _) {
22222222
alt struct(cx.tcx, actual) {
2223-
ty::ty_param(actual_n, _) when expected_n == actual_n {
2223+
ty::ty_param(actual_n, _) if expected_n == actual_n {
22242224
ret ures_ok(expected);
22252225
}
22262226
_ { ret ures_err(terr_mismatch); }

trunk/src/comp/syntax/parse/lexer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fn scan_digits(rdr: reader, radix: uint) -> str {
182182
let c = rdr.curr();
183183
if c == '_' { rdr.bump(); cont; }
184184
alt char::maybe_digit(c) {
185-
some(d) when (d as uint) < radix {
185+
some(d) if (d as uint) < radix {
186186
str::push_byte(rslt, c as u8);
187187
rdr.bump();
188188
}

trunk/src/comp/syntax/parse/parser.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ fn mk_pexpr(p: parser, lo: uint, hi: uint, node: ast::expr_) -> pexpr {
753753

754754
fn to_expr(e: pexpr) -> @ast::expr {
755755
alt e.node {
756-
ast::expr_tup(es) when vec::len(es) == 1u { es[0u] }
756+
ast::expr_tup(es) if vec::len(es) == 1u { es[0u] }
757757
_ { *e }
758758
}
759759
}
@@ -1020,7 +1020,7 @@ fn parse_dot_or_call_expr_with(p: parser, e0: pexpr) -> pexpr {
10201020
while !expr_is_complete(p, e) {
10211021
alt p.peek() {
10221022
// expr(...)
1023-
token::LPAREN. when permits_call(p) {
1023+
token::LPAREN. if permits_call(p) {
10241024
let es = parse_seq(token::LPAREN, token::RPAREN,
10251025
seq_sep(token::COMMA), parse_expr, p);
10261026
hi = es.span.hi;
@@ -1029,7 +1029,7 @@ fn parse_dot_or_call_expr_with(p: parser, e0: pexpr) -> pexpr {
10291029
}
10301030

10311031
// expr {|| ... }
1032-
token::LBRACE. when is_bar(p.look_ahead(1u)) && permits_call(p) {
1032+
token::LBRACE. if is_bar(p.look_ahead(1u)) && permits_call(p) {
10331033
p.bump();
10341034
let blk = parse_fn_block_expr(p);
10351035
alt e.node {

trunk/src/test/run-pass/block-arg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn main() {
2929
false { }
3030
}
3131
alt 3 {
32-
_ when vec::any(v) { |e| float::is_negative(e) } {
32+
_ if vec::any(v) { |e| float::is_negative(e) } {
3333
}
3434
_ {
3535
fail "wrong answer.";

trunk/src/test/run-pass/guards.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
fn main() {
22
let a =
3-
alt 10 { x when x < 7 { 1 } x when x < 11 { 2 } 10 { 3 } _ { 4 } };
3+
alt 10 { x if x < 7 { 1 } x if x < 11 { 2 } 10 { 3 } _ { 4 } };
44
assert (a == 2);
55

66
let b =
77
alt {x: 10, y: 20} {
8-
x when x.x < 5 && x.y < 5 { 1 }
9-
{x: x, y: y} when x == 10 && y == 20 { 2 }
8+
x if x.x < 5 && x.y < 5 { 1 }
9+
{x: x, y: y} if x == 10 && y == 20 { 2 }
1010
{x: x, y: y} { 3 }
1111
};
1212
assert (b == 2);

trunk/src/test/run-pass/unreachable-code.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn ret_ret() -> int { ret (ret 2) + 3; }
3131

3232
fn ret_guard() {
3333
alt 2 {
34-
x when (ret) { x; }
34+
x if (ret) { x; }
3535
}
3636
}
3737

trunk/src/test/stdtest/math.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ fn test_sqrt() {
251251
fn test_angle() {
252252
fn angle(vec: (float, float)) -> float {
253253
alt vec {
254-
(0f, y) when y < 0f { 1.5 * consts::pi }
254+
(0f, y) if y < 0f { 1.5 * consts::pi }
255255
(0f, y) { 0.5 * consts::pi }
256256
(x, y) { float::atan(y / x) }
257257
}

0 commit comments

Comments
 (0)