-
Notifications
You must be signed in to change notification settings - Fork 888
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
Projections of nested tuple structs turn into syntax errors #1063
Comments
Hmmm.. not sure how we should format this. Perhaps the best solution is just to force a multi-line format when two consecutive tuple accesses are detected. |
My preference would be to inject a single space as in the example above, although I have no idea how difficult that'd be. Requiring a newline seems weird, given that it'd make extremely short lines. |
I would prefer this way though,
|
@srinivasreddy That's what I wound up doing to make the present rustfmt accept my code, and I'd be 100% OK with rustfmt generating that if it's as easy or easier than my proposal. |
Start with this valid code (playpen: https://is.gd/rPUytX):
Click "format"; rustfmt will delete the space in
.0 .0
, but.0.0
is a syntax error because the lexer interprets0.0
as a float literal.The text was updated successfully, but these errors were encountered: