about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorSeiichi Uchida <seuchida@gmail.com>2018-06-09 17:36:44 +0900
committerSeiichi Uchida <seuchida@gmail.com>2018-06-10 10:37:38 +0900
commit699be418097489780e22aeb93e7b62975c565187 (patch)
tree0b1b3f5ac1f6073bc26dc631117af896ac53bdef /src/libsyntax/parse/parser.rs
parent78a19d9b88d499449e53ebfb89301b36810e3c34 (diff)
downloadrust-699be418097489780e22aeb93e7b62975c565187.tar.gz
rust-699be418097489780e22aeb93e7b62975c565187.zip
Simplify an error handling in the parser
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 5428842c7f7..3fc376fca60 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -4886,6 +4886,8 @@ impl<'a> Parser<'a> {
                     bounds.push(RegionTyParamBound(self.expect_lifetime()));
                     if has_parens {
                         self.expect(&token::CloseDelim(token::Paren))?;
+                        self.span_err(self.prev_span,
+                                      "parenthesized lifetime bounds are not supported");
                     }
                 } else {
                     let lifetime_defs = self.parse_late_bound_lifetime_defs()?;
@@ -4901,12 +4903,6 @@ impl<'a> Parser<'a> {
                     };
                     bounds.push(TraitTyParamBound(poly_trait, modifier));
                 }
-                if has_parens {
-                    if let Some(&RegionTyParamBound(..)) = bounds.last() {
-                        self.span_err(self.prev_span,
-                                      "parenthesized lifetime bounds are not supported");
-                    }
-                }
             } else {
                 break
             }