Skip to content

pretty-printer does not preserve parens in (a = 10).x; #919

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

Closed
jruderman opened this issue Sep 14, 2011 · 1 comment
Closed

pretty-printer does not preserve parens in (a = 10).x; #919

jruderman opened this issue Sep 14, 2011 · 1 comment
Labels
A-pretty Area: Pretty printing (including `-Z unpretty`)

Comments

@jruderman
Copy link
Contributor

Issue #890 took care of the simple case, but this more complex case is still broken.

fn g() { (a = 10).x; }

becomes

fn g() { a = 10.x; }

which does not parse.

@jruderman
Copy link
Contributor Author

Even worse is

fn g() { (a = b).x; }

pretty-printing as

fn g() { a = b.x; }

which does parse but has different semantics.

marijnh added a commit that referenced this issue Sep 15, 2011
This is needed to fix the second example in issue #919
bors pushed a commit to rust-lang-ci/rust that referenced this issue Oct 26, 2020
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pretty Area: Pretty printing (including `-Z unpretty`)
Projects
None yet
Development

No branches or pull requests

2 participants