Skip to content

fix: negative nums in concat! expansion #19434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
@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/limbo that referenced this pull request Apr 27, 2025
…yzer bug that incorrectly expands negative integers in proc_macros: rust-lang/rust-analyzer#19434
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!
3 participants