rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Backport 3999

Open ytmimi opened this issue 3 years ago • 4 comments

Do not remove comment from an import with a single item (#3999)

ytmimi avatar Apr 01 '22 16:04 ytmimi

I haven't had a chance to check yet, but it's likely that this backport will fix #4708 and #3984

ytmimi avatar Apr 04 '22 13:04 ytmimi

This has conflicts that will need to be resolved, though may be worth waiting to do so until after some other PRs land given the likely overlap of modified code

calebcartwright avatar May 31 '22 00:05 calebcartwright

Now that we retain the comments this test case from #3984 is giving us some trouble use a::item /* comment */;

use a::item /* comment */; gets formatted as use a::item; /* comment */; Note the extra semicolon after the comment.

ytmimi avatar Jul 21 '22 05:07 ytmimi

@calebcartwright Do you think it would be best to drop the test cases for #3984 and address that issue in a separate PR or to try and get that sorted out in this PR as well?

ytmimi avatar Sep 13 '22 13:09 ytmimi

The backport was completed by https://github.com/rust-lang/rustfmt/pull/5853

ytmimi avatar Aug 31 '23 04:08 ytmimi