Skip to content
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

maintain more AST info when formatting a RHS #5113

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

calebcartwright
Copy link
Member

We currently utilize generics, primarily bound on our Rewrite trait, when formatting a RHS (e.g. on an assignment) which makes perfect sense given the high number of expression variants, bounds, etc. that can be encountered. However, in doing so the functions that actually define the logic which handles orchestrating the rewriting of the RHS and then combining it with the LHS are missing various data points from the respective AST nodes.

That's not been a problem historically, however, we have a few outstanding requests for more optionality around formatting of chains including formatting results which knowingly exceed the max_width boundary. In order to support these use cases while still being able to block indent the start of the RHS some additional AST metadata will be needed, and that metadata is accordingly incorporated and passed along with the changes in this PR.

Refs #3863 #4306

@calebcartwright calebcartwright merged commit 0fc846f into rust-lang:master Nov 29, 2021
@calebcartwright calebcartwright deleted the rhs-ast-info branch November 29, 2021 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant