about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-03-26 12:32:32 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-03-26 12:32:32 -0700
commit8d1cc72cf9fca507f4e14fad88f7269594305846 (patch)
tree77a8857259f71cf64c06b1ae3b1b22064782077c /src/libsyntax/parse
parent1bb3694b1a6368f456c2e62cf234a332a21df2a0 (diff)
downloadrust-8d1cc72cf9fca507f4e14fad88f7269594305846.tar.gz
rust-8d1cc72cf9fca507f4e14fad88f7269594305846.zip
Add specific message for tuple struct invoked with suffixed numeric field name
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index bb3dc8edfb0..71dde91e654 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -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 {