summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2015-09-07 22:15:36 +0300
committerAleksey Kladov <aleksey.kladov@gmail.com>2015-09-07 22:15:36 +0300
commit0e96c2823649b92fee835046e7073e428408931a (patch)
tree4a0ef4a33360aceafda060c4b86f642b3f385d0f /src/libsyntax/parse
parentc8da5697e0721641856c8e38b666a9798e9f761d (diff)
downloadrust-0e96c2823649b92fee835046e7073e428408931a.tar.gz
rust-0e96c2823649b92fee835046e7073e428408931a.zip
libsyntax: restore lost error message
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index b13522af82d..543ca885110 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -4726,9 +4726,13 @@ impl<'a> Parser<'a> {
             let fields = try!(self.parse_record_struct_body(&class_name));
             (fields, None)
         // Tuple-style struct definition with optional where-clause.
-        } else {
+        } else if self.token == token::OpenDelim(token::Paren) {
             let fields = try!(self.parse_tuple_struct_body(&class_name, &mut generics));
             (fields, Some(ast::DUMMY_NODE_ID))
+        } else {
+            let token_str = self.this_token_to_string();
+            return Err(self.fatal(&format!("expected `where`, `{}`, `(`, or `;` after struct \
+                                            name, found `{}`", "{", token_str)))
         };
 
         Ok((class_name,