Skip to content

Commit c8301e6

Browse files
committed
Fixed semicolon getting moved into comment (fixes rust-lang#4646)
1 parent a97fd77 commit c8301e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/formatting/items.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,10 @@ impl<'a> FmtVisitor<'a> {
434434
FnBraceStyle::None,
435435
)?;
436436

437+
if last_line_contains_single_line_comment(&result) {
438+
result.push('\n');
439+
}
440+
437441
// Re-attach semicolon
438442
result.push(';');
439443

0 commit comments

Comments
 (0)