about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-08-22 22:01:00 -0400
committerGitHub <noreply@github.com>2025-08-22 22:01:00 -0400
commit8cabd61dca14159378e58c8c5e6772d0eb9e664b (patch)
tree1fbe83d030eeef5a526e30297404950a61e889ce /compiler
parentd3c9908a8a91e8d732201caac2c809d4e96d0027 (diff)
parentf43f974b9e14af328b7982d6320cc4d7a9104410 (diff)
downloadrust-8cabd61dca14159378e58c8c5e6772d0eb9e664b.tar.gz
rust-8cabd61dca14159378e58c8c5e6772d0eb9e664b.zip
Rollup merge of #145751 - epage:infostring, r=joshtriplett
fix(lexer): Allow '-' in the frontmatter infostring continue set

This more closely matches the RFC and what our T-lang contact has asked
for, see https://github.com/rust-lang/rust/issues/136889#issuecomment-3212715312

Tracking issue: rust-lang/rust#136889
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_lexer/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_lexer/src/lib.rs b/compiler/rustc_lexer/src/lib.rs
index e80196ed567..483cc3e93dc 100644
--- a/compiler/rustc_lexer/src/lib.rs
+++ b/compiler/rustc_lexer/src/lib.rs
@@ -540,11 +540,11 @@ impl Cursor<'_> {
         // whitespace between the opening and the infostring.
         self.eat_while(|ch| ch != '\n' && is_whitespace(ch));
 
-        // copied from `eat_identifier`, but allows `.` in infostring to allow something like
+        // copied from `eat_identifier`, but allows `-` and `.` in infostring to allow something like
         // `---Cargo.toml` as a valid opener
         if is_id_start(self.first()) {
             self.bump();
-            self.eat_while(|c| is_id_continue(c) || c == '.');
+            self.eat_while(|c| is_id_continue(c) || c == '-' || c == '.');
         }
 
         self.eat_while(|ch| ch != '\n' && is_whitespace(ch));