You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which will make rustc unable to compile the file because 2...X is not a valid syntax for ranges, however having the space lets rustc know that 2 is supposed to be a float and the dots represent a range.
Proposed fix:
Either do not remove the spaces in this case, or add a 0 in the case of floats.
The text was updated successfully, but these errors were encountered:
There's currently a proposal to add an option to rustfmt to always add 0 to the end of float literals (#5834). We've also had similar issues in the past (#5791 for example and #4808 is similarly related), and in those cases we resolved the issue by wrapping the item with the trialing . in parenthesis. We might need to do the same thing here.
In the meantime it probably makes sense to manually add a 0 to work around this issue.
In this code snippet
Running rust format will change this code to
Which will make rustc unable to compile the file because 2...X is not a valid syntax for ranges, however having the space lets rustc know that 2 is supposed to be a float and the dots represent a range.
Proposed fix:
Either do not remove the spaces in this case, or add a 0 in the case of floats.
The text was updated successfully, but these errors were encountered: