about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-01-21 04:26:15 -0800
committerbors <bors@rust-lang.org>2014-01-21 04:26:15 -0800
commit43cffe9d719170bd342b10d1bb81911f0e14a7c4 (patch)
tree897cd7f2eb52770a2dd4d4c69efc47e1ecc7b4f7 /src/libsyntax/parse
parent40df5a2e9ac81f445c7122a484618918b752a1e2 (diff)
parent39713b829535b40aff2b7f368839d07ea7c2bf11 (diff)
downloadrust-43cffe9d719170bd342b10d1bb81911f0e14a7c4.tar.gz
rust-43cffe9d719170bd342b10d1bb81911f0e14a7c4.zip
auto merge of #11663 : huonw/rust/paren-lint, r=cmr
The parens in `if (true) {}` are not necessary, so we'll warn about them.

cc #3070 and #11432
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/lexer.rs2
-rw-r--r--src/libsyntax/parse/parser.rs6
-rw-r--r--src/libsyntax/parse/token.rs2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index 885cfbcbdbe..f753861892f 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -198,7 +198,7 @@ fn fatal_span_verbose(rdr: @StringReader,
 // EFFECT: advance peek_tok and peek_span to refer to the next token.
 // EFFECT: update the interner, maybe.
 fn string_advance_token(r: @StringReader) {
-    match (consume_whitespace_and_comments(r)) {
+    match consume_whitespace_and_comments(r) {
         Some(comment) => {
             r.peek_span.set(comment.sp);
             r.peek_tok.set(comment.tok);
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index e79c845b24d..3a5e737e026 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3393,7 +3393,7 @@ impl Parser {
 
         let mut attributes_box = attrs_remaining;
 
-        while (self.token != token::RBRACE) {
+        while self.token != token::RBRACE {
             // parsing items even when they're not allowed lets us give
             // better error messages and recover more gracefully.
             attributes_box.push_all(self.parse_outer_attributes());
@@ -4373,7 +4373,7 @@ impl Parser {
             items: _,
             foreign_items: foreign_items
         } = self.parse_foreign_items(first_item_attrs, true);
-        if (! attrs_remaining.is_empty()) {
+        if ! attrs_remaining.is_empty() {
             self.span_err(self.last_span,
                           "expected item after attributes");
         }
@@ -4553,7 +4553,7 @@ impl Parser {
             if !self.eat(&token::COMMA) { break; }
         }
         self.expect(&token::RBRACE);
-        if (have_disr && !all_nullary) {
+        if have_disr && !all_nullary {
             self.fatal("discriminator values can only be used with a c-like \
                         enum");
         }
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 42313e64283..56681ef2def 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -218,7 +218,7 @@ pub fn to_str(input: @IdentInterner, t: &Token) -> ~str {
             &NtAttr(e) => ::print::pprust::attribute_to_str(e, input),
             _ => {
                 ~"an interpolated " +
-                    match (*nt) {
+                    match *nt {
                         NtItem(..) => ~"item",
                         NtBlock(..) => ~"block",
                         NtStmt(..) => ~"statement",