1
Fork 0

Add specific message for tuple struct invoked with suffixed numeric field name

This commit is contained in:
Esteban Küber 2019-03-26 12:32:32 -07:00
parent 1bb3694b1a
commit 8d1cc72cf9
3 changed files with 21 additions and 2 deletions

View file

@ -2491,7 +2491,8 @@ impl<'a> Parser<'a> {
}
fn parse_field_name(&mut self) -> PResult<'a, Ident> {
if let token::Literal(token::Integer(name), None) = self.token {
if let token::Literal(token::Integer(name), suffix) = self.token {
self.expect_no_suffix(self.span, "a tuple index", suffix);
self.bump();
Ok(Ident::new(name, self.prev_span))
} else {