You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Everything works as expected if there is actual code in the block or if the block is empty so the issue isn't too bad. Just thought it was worth mentioning.
ExPixel
changed the title
Empty cfg block with comment duplicates line.
Cfg block containing only a comment duplicates the previous lines.
Oct 12, 2020
This is due to an upstream rustc bug that's subsequently been resolved, previously reported and discussed on the thread linked below. Closing as a duplicate, will go away after our next update. #4452 (comment) #4452 (comment)
Describe the bug
Formatting an empty
cfg
block with a comment causesrustfmt
to duplicate thecfg
line.gets formatted into
Everything works as expected if there is actual code in the block or if the block is empty so the issue isn't too bad. Just thought it was worth mentioning.
To Reproduce
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=161085030374989f3243ad8eeb0328f5
Running
rustfmt
on the playground should display the weird behavior.Expected behavior
I expect the output to just be
Meta
rustfmt
invim
The text was updated successfully, but these errors were encountered: