Open
Description
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 the normalize_comments
, wrap_comments
, or format_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
wrap_comments = true
code.rs
//! I am a humble module doc comment with many trailing lines
//!
//!
Run
# rustfmt code.rs
Expected
code.rs
//! I am a humble module doc comment with many trailing lines
Actual
code.rs
//! I am a humble module doc comment with many trailing lines
//!