-
Couldn't load subscription status.
- Fork 962
Open
Labels
S-fixed-needs-subtree-syncStatus: fixed, but needs a subtree syncStatus: fixed, but needs a subtree syncUO-wrap_commentsUnstable option: wrap_commentsUnstable option: wrap_commentsonly-with-optionRequires a non-default option value to reproduceRequires a non-default option value to reproduce
Description
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.
Metadata
Metadata
Assignees
Labels
S-fixed-needs-subtree-syncStatus: fixed, but needs a subtree syncStatus: fixed, but needs a subtree syncUO-wrap_commentsUnstable option: wrap_commentsUnstable option: wrap_commentsonly-with-optionRequires a non-default option value to reproduceRequires a non-default option value to reproduce