We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8da569 commit 0e96c28Copy full SHA for 0e96c28
src/libsyntax/parse/parser.rs
@@ -4726,9 +4726,13 @@ impl<'a> Parser<'a> {
4726
let fields = try!(self.parse_record_struct_body(&class_name));
4727
(fields, None)
4728
// Tuple-style struct definition with optional where-clause.
4729
- } else {
+ } else if self.token == token::OpenDelim(token::Paren) {
4730
let fields = try!(self.parse_tuple_struct_body(&class_name, &mut generics));
4731
(fields, Some(ast::DUMMY_NODE_ID))
4732
+ } else {
4733
+ let token_str = self.this_token_to_string();
4734
+ return Err(self.fatal(&format!("expected `where`, `{}`, `(`, or `;` after struct \
4735
+ name, found `{}`", "{", token_str)))
4736
};
4737
4738
Ok((class_name,
0 commit comments