This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +47
-2
lines changed Expand file tree Collapse file tree 2 files changed +47
-2
lines changed Original file line number Diff line number Diff line change @@ -450,9 +450,20 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
450450 fn print_comment ( & mut self , cmnt : & comments:: Comment ) {
451451 match cmnt. style {
452452 comments:: Mixed => {
453- assert_eq ! ( cmnt. lines. len( ) , 1 ) ;
454453 self . zerobreak ( ) ;
455- self . word ( cmnt. lines [ 0 ] . clone ( ) ) ;
454+ if let Some ( ( last, lines) ) = cmnt. lines . split_last ( ) {
455+ self . ibox ( 0 ) ;
456+
457+ for line in lines {
458+ self . word ( line. clone ( ) ) ;
459+ self . hardbreak ( )
460+ }
461+
462+ self . word ( last. clone ( ) ) ;
463+ self . space ( ) ;
464+
465+ self . end ( ) ;
466+ }
456467 self . zerobreak ( )
457468 }
458469 comments:: Isolated => {
Original file line number Diff line number Diff line change 1+ fn main ( /*
2+ ---
3+ */ ) {
4+ let x /* this is one line */ = 3 ;
5+
6+ let x /*
7+ * this
8+ * is
9+ * multiple
10+ * lines
11+ */ = 3 ;
12+
13+ let x = /*
14+ * this
15+ * is
16+ * multiple
17+ * lines
18+ * after
19+ * the
20+ * =
21+ */ 3 ;
22+
23+ let x /*
24+ * this
25+ * is
26+ * multiple
27+ * lines
28+ * including
29+ * a
30+
31+ * blank
32+ * line
33+ */ = 3 ;
34+ }
You can’t perform that action at this time.
0 commit comments