Trailing blank line removal in doc comments is not idempotent #6168
Labels
a-comments
bug
Panic, non-idempotency, invalid code, etc.
only-with-option
requires a non-default option value to reproduce
Description
Only one trailing, blank line in a comment is removed each time
rustfmt
is run, so formatting is not idempotent if multiple trailing, blank lines are present. Blank line removal is enabled by any of thenormalize_comments
,wrap_comments
, orformat_code_in_doc_comments
(for doc comments only) configuration options. All these features are unstable, so this affects nightly only (as of 2024-05-21 / d5f1200)This issue is fixed by PR #6163.
Reproduction
Given
rustfmt.toml
code.rs
Run
# rustfmt code.rs
Expected
code.rs
//! I am a humble module doc comment with many trailing lines
Actual
code.rs
The text was updated successfully, but these errors were encountered: