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

Indent return types separated from params by newline #4368

Merged
merged 2 commits into from
Aug 7, 2020

Conversation

ayazhafiz
Copy link
Contributor

#3891 removed Version One formatting that did this correctly (https://github.com/rust-lang/rustfmt/pull/3891/files#diff-5db152a52bdaeae9dacd35f43a4a78ddL2342-L2344),
but at seemingly at the time there were no tests to catch the
regression.

This commit fix-forwards the formatting regression, though via a different
implementation because the original implementation would muddle the branch
for visual indentation and this fix, which is probably not preferrable
giving the existing complexity of the rewrite_required_fn method.

Closes #4366

 rust-lang#3891 removed Version One formatting that did this correctly (https://github.com/rust-lang/rustfmt/pull/3891/files#diff-5db152a52bdaeae9dacd35f43a4a78ddL2342-L2344),
but at seemingly at the time there were no tests to catch the
regression.

This commit fix-forwards the formatting regression, though via a different
implementation because the original implementation would muddle the branch
for visual indentation and this fix, which is probably not preferrable
giving the existing complexity of the rewrite_required_fn method.

Closes rust-lang#4366
src/formatting/items.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@ahl ahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; thanks for fixing this.

@calebcartwright
Copy link
Member

Thanks @ayazhafiz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.0.0-rc.2 formatting regression with line-wrapped functions
4 participants