Skip to content

Comment before where removed (traits only) #4211

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
vmx opened this issue May 29, 2020 · 0 comments · Fixed by #4213
Closed

Comment before where removed (traits only) #4211

vmx opened this issue May 29, 2020 · 0 comments · Fixed by #4213
Labels
a-comments bug Panic, non-idempotency, invalid code, etc.

Comments

@vmx
Copy link

vmx commented May 29, 2020

There are already some issues about comments being removed by rustfmt, most notable #2781 and #3669.

I dare to open yet another issue as it's interesting that the removal happens for traits, but not for structs.

trait SomeTrait<T>
// This comment will be removed by rustfmt
where
   T: Copy,
{
}


struct SomeStruct<T>
// This comment won't be touched
where
    T: Copy,
{
    data: T,
}
@topecongiro topecongiro added a-comments bug Panic, non-idempotency, invalid code, etc. labels May 29, 2020
ayazhafiz added a commit to ayazhafiz/rustfmt that referenced this issue May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-comments bug Panic, non-idempotency, invalid code, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants