Skip to content

Commit b402a38

Browse files
committed
---
yaml --- r: 40252 b: refs/heads/dist-snap c: 1dc4d02 h: refs/heads/master v: v3
1 parent 8aff059 commit b402a38

File tree

24 files changed

+252
-155
lines changed

24 files changed

+252
-155
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
99
refs/heads/incoming: e90142e536c150df0d9b4b2f11352152177509b5
10-
refs/heads/dist-snap: 62f98c8ff8179c9754718e62285b82b50dfcfe26
10+
refs/heads/dist-snap: 1dc4d024a88b6d2a6a31aad8d09d62c4dc883a85
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/mk/tests.mk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,22 @@ cleantestlibs:
9393
| xargs rm -rf
9494

9595
check: cleantestlibs cleantmptestlogs tidy all check-stage2
96-
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
96+
$(Q)$(S)src/etc/check-summary.py tmp/*.log
9797

9898
check-notidy: cleantestlibs cleantmptestlogs all check-stage2
99-
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
99+
$(Q)$(S)src/etc/check-summary.py tmp/*.log
100100

101101
check-full: cleantestlibs cleantmptestlogs tidy \
102102
all check-stage1 check-stage2 check-stage3
103-
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
103+
$(Q)$(S)src/etc/check-summary.py tmp/*.log
104104

105105
check-test: cleantestlibs cleantmptestlogs all check-stage2-rfail
106-
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
106+
$(Q)$(S)src/etc/check-summary.py tmp/*.log
107107

108108
check-lite: cleantestlibs cleantmptestlogs rustc-stage2 \
109109
check-stage2-core check-stage2-std check-stage2-rpass \
110110
check-stage2-rfail check-stage2-cfail
111-
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
111+
$(Q)$(S)src/etc/check-summary.py tmp/*.log
112112

113113
# Run the tidy script in multiple parts to avoid huge 'echo' commands
114114
ifdef CFG_NOTIDY

branches/dist-snap/src/libsyntax/ast.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -744,10 +744,7 @@ enum expr_ {
744744
expr_struct(@path, ~[field], Option<@expr>),
745745

746746
// A vector literal constructed from one repeated element.
747-
expr_repeat(@expr /* element */, @expr /* count */, mutability),
748-
749-
// No-op: used solely so we can pretty-print faithfully
750-
expr_paren(@expr)
747+
expr_repeat(@expr /* element */, @expr /* count */, mutability)
751748
}
752749

753750
#[auto_serialize]

branches/dist-snap/src/libsyntax/fold.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,7 @@ fn noop_fold_expr(e: expr_, fld: ast_fold) -> expr_ {
494494
expr_struct(fld.fold_path(path),
495495
vec::map(fields, |x| fold_field(*x)),
496496
option::map(&maybe_expr, |x| fld.fold_expr(*x)))
497-
},
498-
expr_paren(ex) => expr_paren(fld.fold_expr(ex))
497+
}
499498
}
500499
}
501500

branches/dist-snap/src/libsyntax/parse/classify.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,39 @@ fn stmt_ends_with_semi(stmt: ast::stmt) -> bool {
3636
}
3737
}
3838
}
39+
40+
fn need_parens(expr: @ast::expr, outer_prec: uint) -> bool {
41+
match expr.node {
42+
ast::expr_binary(op, _, _) => operator_prec(op) < outer_prec,
43+
ast::expr_cast(_, _) => parse::prec::as_prec < outer_prec,
44+
// This may be too conservative in some cases
45+
ast::expr_assign(_, _) => true,
46+
ast::expr_swap(_, _) => true,
47+
ast::expr_assign_op(_, _, _) => true,
48+
ast::expr_ret(_) => true,
49+
ast::expr_assert(_) => true,
50+
ast::expr_log(_, _, _) => true,
51+
_ => !parse::classify::expr_requires_semi_to_be_stmt(expr)
52+
}
53+
}
54+
55+
fn ends_in_lit_int(ex: @ast::expr) -> bool {
56+
match ex.node {
57+
ast::expr_lit(node) => match node {
58+
@{node: ast::lit_int(_, ast::ty_i), _}
59+
| @{node: ast::lit_int_unsuffixed(_), _} => true,
60+
_ => false
61+
},
62+
ast::expr_binary(_, _, sub) | ast::expr_unary(_, sub) |
63+
ast::expr_copy(sub) | ast::expr_assign(_, sub) |
64+
ast::expr_assign_op(_, _, sub) | ast::expr_swap(_, sub) |
65+
ast::expr_log(_, _, sub) | ast::expr_assert(sub) => {
66+
ends_in_lit_int(sub)
67+
}
68+
ast::expr_fail(osub) | ast::expr_ret(osub) => match osub {
69+
Some(ex) => ends_in_lit_int(ex),
70+
_ => false
71+
},
72+
_ => false
73+
}
74+
}

0 commit comments

Comments
 (0)