Closed
Description
This was an issue discovered when implementing a fix for #5122 in PR #5124 (comment). The issue is reproducible on rustfmt 1.4.38-nightly (8572b343 2022-04-24)
and uses the rustfmt.toml
defined in the rustfmt repo.
# rustfmt.toml
error_on_line_overflow = true
error_on_unformatted = true
version = "Two"
This input:
// Non-doc pre-comment of Foo
/// doc of Foo
// Non-doc post-comment of Foo
struct Foo<
// Non-doc pre-comment of 'a
/// doc of 'a
// Non-doc post-comment of 'a
'a,
// Non-doc pre-comment of T
/// doc of T
// Non-doc post-comment of T
T,
// Non-doc pre-comment of N
/// doc of N
// Non-doc post-comment of N
const N: item,
>;
Gets formatted as follows:
// Non-doc pre-comment of Foo
/// doc of Foo
// Non-doc post-comment of Foo
struct Foo<
// Non-doc pre-comment of 'a
/// doc of 'a
'a,
// Non-doc pre-comment of T
/// doc of T
T,
// Non-doc pre-comment of N
/// doc of N
const N: item,
>;