-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Negative float literals are not parsed after procedural macro #6028
Comments
The work-around for this bug is a bit cumbersome, so I am hoping that providing more information might increase the chances of this getting fixed: I think the problem is this:
In a nutshell, the problem is first caused by the fact that:
There are three places where this might be fixed:
Unfortunately, none of 1-3 are currently implemented and as a result, importing a procedural macro that does One more thing: in the Any thoughts? |
I submitted a similar issue to |
Disclaimer: I am not 100% sure whether this is a bug in RA or a missing validation in Rustc.
When writing
-4.0f32
in Rust, it is usually parsed as two different tokens (a minus operator and a float literal).But a procedural macro can also generate new tokens, including negative float literals:
or even shorter
Unfortunately, these currently cause RA to crash:
I use this as a temporary workaround, but it is clearly not ideal:
The text was updated successfully, but these errors were encountered: