about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/mod.rs
diff options
context:
space:
mode:
authorJieyou Xu <jieyouxu@outlook.com>2025-08-15 23:39:33 +0800
committerJieyou Xu <jieyouxu@outlook.com>2025-08-18 21:57:11 +0800
commitddd99930f34b79f209c61cc25706a1dac1173762 (patch)
treec0a99b90beba9a9a5b5e8bc29e6534b6d783bbd8 /compiler/rustc_parse/src/parser/mod.rs
parenteb3441b25a7acbce8cec0571b3f8ec87cca8c349 (diff)
downloadrust-ddd99930f34b79f209c61cc25706a1dac1173762.tar.gz
rust-ddd99930f34b79f209c61cc25706a1dac1173762.zip
Turn invalid index suffixes into hard errors
Diffstat (limited to 'compiler/rustc_parse/src/parser/mod.rs')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 41ed1f95a01..db72faf4ec7 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -1333,7 +1333,10 @@ impl<'a> Parser<'a> {
         if let token::Literal(token::Lit { kind: token::Integer, symbol, suffix }) = self.token.kind
         {
             if let Some(suffix) = suffix {
-                self.expect_no_tuple_index_suffix(self.token.span, suffix);
+                self.dcx().emit_err(errors::InvalidLiteralSuffixOnTupleIndex {
+                    span: self.token.span,
+                    suffix,
+                });
             }
             self.bump();
             Ok(Ident::new(symbol, self.prev_token.span))