Skip to content

Conversation

@vishruth-thimmaiah
Copy link
Contributor

Fixes: #19417

This PR provides a fix to the expansion of the concat! macro, where negative numbers give an unexpected token error.

 pub const T: &str = concat!(-42.0);

expands to:

pub const T: &str = "-42.0"

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 23, 2025
@vishruth-thimmaiah vishruth-thimmaiah force-pushed the negatives_in_concat branch 2 times, most recently from 2eeccd5 to ca352e0 Compare March 23, 2025 21:03
@pedrocarlo
Copy link

Hey @Veykril, sorry about the ping. Unfortunately, I'm suffering immensely from this bug. The fix here seems to be pretty simple to me. How hard would it be for this to be merged? Thanks for the great work you are putting into Rust Analyzer!

pedrocarlo added a commit to pedrocarlo/turso that referenced this pull request Apr 27, 2025
…yzer bug that incorrectly expands negative integers in proc_macros: rust-lang/rust-analyzer#19434
pedrocarlo added a commit to pedrocarlo/turso that referenced this pull request May 3, 2025
…yzer bug that incorrectly expands negative integers in proc_macros: rust-lang/rust-analyzer#19434
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nits, otherwise looks good to me, thanks!

@Veykril Veykril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 5, 2025
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 5, 2025
@Veykril Veykril added this pull request to the merge queue May 5, 2025
Merged via the queue into rust-lang:master with commit fa759f7 May 5, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong unexpected token diagnostic when passing negative numbers to concat!

4 participants