Summary
Doc comment formatting inconsistency when using wrap_comments = true with max_width = 20: an extra blank line is inserted before code blocks.
# rustfmt.toml
wrap_comments = true
max_width = 20
/// Some doc comment with code snippet:
///```
/// '\u{1F}
/// ```
pub struct Code {}
Additional Context
This issue was discovered while attempting to fix other issues in rust-lang/rustfmt.
The latest rustfmt (rustfmt 1.8.0-nightly (6ac1fcd7a3 2025-10-09)) produces the correct output without the extra blank line. This issue is being filed to track this regression and verify whether it gets fixed after the next sync from rust-lang/rustfmt to rust-lang/rust.
Summary
Doc comment formatting inconsistency when using
wrap_comments = truewithmax_width = 20: an extra blank line is inserted before code blocks.Additional Context
This issue was discovered while attempting to fix other issues in
rust-lang/rustfmt.The latest rustfmt (
rustfmt 1.8.0-nightly (6ac1fcd7a3 2025-10-09)) produces the correct output without the extra blank line. This issue is being filed to track this regression and verify whether it gets fixed after the next sync fromrust-lang/rustfmttorust-lang/rust.