You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suspect this has the same underlying issue as #5531.
Taking a look at #5531 (comment). I've explained that rustfmt isn't taking the doc comment opener into account. Furthermore, when rewriting macros rustfmt doesn't remove trailing commas.
rustfmt would love to produce this output, but it's 101 characters long
and because it exceeds the max_width rustfmt can't reformat the code block. If you remove the trailing comma:
/// ```/// use buck::types::TargetLabel;///////// use buck::types::TargetPattern;//////////////////////// assert!(!/// TargetPattern::new("foo//bar/...").matches(&TargetLabel::new("foo//moo/bar/baz:qux")) /// );/// ```fnmatches(){}
You'll get:
/// ```/// use buck::types::TargetLabel;////// use buck::types::TargetPattern;////// assert!(!TargetPattern::new("foo//bar/...").matches(&TargetLabel::new("foo//moo/bar/baz:qux")));/// ```fnmatches(){}
Additionally, I got code formatting to work when I set doc_comment_code_block_width=99, which further leads me to believe that this is a width related issue similar to #5531.
The minimal example I could find:
Outputs:
So, first comment is reformatted, and the second is completely skipped. Something in that
assert!
prevents formatting.The text was updated successfully, but these errors were encountered: