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
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!
2 participants