File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -885,6 +885,9 @@ impl<'a> CommentRewrite<'a> {
885885 // Remove space if this is an empty comment or a doc comment.
886886 self . result . pop ( ) ;
887887 }
888+ if self . code_block_attr . is_some ( ) && self . is_prev_line_multi_line {
889+ self . result . push_str ( & self . comment_line_separator ) ;
890+ }
888891 self . result . push_str ( line) ;
889892 self . fmt . shape = Shape :: legacy ( self . max_width , self . fmt_indent ) ;
890893 self . is_prev_line_multi_line = false ;
Original file line number Diff line number Diff line change 1+ // rustfmt-wrap_comments: false
2+
3+ /// Here is me writing some documentation that is too long oh me oh my now some code please!
4+ /// ```
5+ /// test
6+ /// ```
7+ fn foo ( ) { }
Original file line number Diff line number Diff line change 1+ // rustfmt-wrap_comments: true
2+
3+ /// Here is me writing some documentation that is too long oh me oh my now some
4+ /// code please!
5+ /// ```
6+ /// test
7+ /// ```
8+ fn foo ( ) { }
You can’t perform that action at this time.
0 commit comments