Skip to content

Conversation

@ShoyuVanilla
Copy link
Member

@ShoyuVanilla ShoyuVanilla commented Nov 3, 2025

Fixes #20952

For ill-suffixed literals like ""б(Not a number 6 😅), we pass it as fmt_snippet here:

parse::Parser::new(&text, str_style, fmt_snippet, false, parse::ParseMode::Format);

But in that function the following line panics if the string literal has the suffix ending with a char::len_utf8() > 1
https://doc.rust-lang.org/1.91.0/nightly-rustc/src/rustc_parse_format/lib.rs.html#319

We might limplement some diagnostics or error recovery upon those ill-suffixed string literals but that's not quite doable without some non-trivial refactoring in our parser/token tree/expansion infra. The simplest fix would be just erroring on those literals

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 3, 2025
@Veykril Veykril added this pull request to the merge queue Nov 3, 2025
Merged via the queue into rust-lang:master with commit 132d333 Nov 3, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 3, 2025
@ShoyuVanilla ShoyuVanilla deleted the lit-suffix branch November 4, 2025 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panicking

3 participants