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

do not force comments to be indented with a comment trailing a line of code #3833

Merged
merged 1 commit into from
Oct 4, 2019

Conversation

scampi
Copy link
Contributor

@scampi scampi commented Oct 4, 2019

The proposed change assumes that a trailing comment belongs to the code on the same line. To prevent it being mixed with possible comments below it, that trailing comment is not rewritten together with the rest. For the same reason, it does not attempt to wrap the trailing comment.

Close #3792
Close #3826
Close #2996
Close #3254

Copy link
Contributor

@topecongiro topecongiro left a comment

Choose a reason for hiding this comment

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

Awesome, thank you!

@topecongiro topecongiro merged commit fb01dc8 into rust-lang:master Oct 4, 2019
@topecongiro topecongiro added this to the 1.4.9 milestone Oct 4, 2019
@scampi scampi deleted the issue-3792 branch October 5, 2019 10:50
topecongiro added a commit to topecongiro/rustfmt that referenced this pull request Oct 27, 2019
topecongiro added a commit to topecongiro/rustfmt that referenced this pull request Dec 3, 2019
topecongiro added a commit to topecongiro/rustfmt that referenced this pull request Dec 15, 2019
@jeremyko
Copy link

jeremyko commented Mar 11, 2023

Why do I still have the same symptoms? My windows 10's rustfmt version is 1.5.1-stable (d5a82bbd 2023-02-07).

@calebcartwright
Copy link
Member

Why do I still have the same symptoms? My windows 10's rustfmt version is 1.5.1-stable (d5a82bbd 2023-02-07).

The changes made here were largely version gated to avoid breaking the formatting stability guarantee. It's hard to speak to the specifics of your scenario without knowing anything about those specifics, but most likely if you were to run cargo fmt -- --config version=Two (or equivalent manual rustfmt ... command) you'd see those symptoms go away (potentially with other various code changes that accompany v2)

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