libsyntax: restore lost error message

This commit is contained in:
Aleksey Kladov
2015-09-07 22:15:36 +03:00
parent c8da5697e0
commit 0e96c28236

View File

@@ -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,