wrap_comments sometimes introduces trailing whitespace into rustdoc #5421
Labels
1x-backport:pending
Fixed/resolved in source but not yet backported to a 1x branch and release
a-comments
e-trailing whitespace
error[internal]: left behind trailing whitespace
only-with-option
requires a non-default option value to reproduce
This is related to (but I believe separate from) #5420
Whatever situation that rustfmt finds itself in after failing to detect a
cfg_attr
-declared code block, rustfmt then randomly introduces trailing whitespace (which afaik should never happen for regular code, regular comments, regular rustdoc, rustdoc tests/examples).Input, processed with
wrap_comments = true
:Output:
It doesn't actually show on GitHub, but the second to last instance of an empty
//!
line has trailing whitespace after formatting that was not there before formatting.This is the diff between the two with their spaces replaced with an interpunct for visibility into what's happening:
The text was updated successfully, but these errors were encountered: