about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorEzra Shaw <ezrasure@outlook.com>2023-03-17 21:41:26 +1300
committerEzra Shaw <ezrasure@outlook.com>2023-03-19 20:24:06 +1300
commitb4e17a5098f0413b01c90c8505e0f01e8bea50de (patch)
tree48ec7d45ab5f0608ee1ffaadcbf360efceb67ad1 /compiler/rustc_parse/src/errors.rs
parentc9ddb73184290e0698060a80b0b5727d6ee11098 (diff)
downloadrust-b4e17a5098f0413b01c90c8505e0f01e8bea50de.tar.gz
rust-b4e17a5098f0413b01c90c8505e0f01e8bea50de.zip
refactor: improve "ident starts with number" error
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
-rw-r--r--compiler/rustc_parse/src/errors.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs
index 2def5c5b32f..a9d116012ae 100644
--- a/compiler/rustc_parse/src/errors.rs
+++ b/compiler/rustc_parse/src/errors.rs
@@ -986,7 +986,10 @@ impl<'a, G: EmissionGuarantee> IntoDiagnostic<'a, G> for ExpectedIdentifier {
 
 #[derive(Subdiagnostic)]
 #[help(parse_invalid_identifier_with_leading_number)]
-pub(crate) struct HelpIdentifierStartsWithNumber;
+pub(crate) struct HelpIdentifierStartsWithNumber {
+    #[primary_span]
+    pub num_span: Span,
+}
 
 pub(crate) struct ExpectedSemi {
     pub span: Span,