File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -2218,10 +2218,16 @@ fn rewrite_fn_base(
22182218 . map_or ( false , |last_line| last_line. contains ( "//" ) ) ;
22192219
22202220 if context. config . version ( ) == Version :: Two {
2221- result . push ( ')' ) ;
2222- if closing_paren_overflow_max_width || params_last_line_contains_comment {
2221+ if closing_paren_overflow_max_width {
2222+ result . push ( ')' ) ;
22232223 result. push_str ( & indent. to_string_with_newline ( context. config ) ) ;
22242224 no_params_and_over_max_width = true ;
2225+ } else if params_last_line_contains_comment {
2226+ result. push_str ( & indent. to_string_with_newline ( context. config ) ) ;
2227+ result. push ( ')' ) ;
2228+ no_params_and_over_max_width = true ;
2229+ } else {
2230+ result. push ( ')' ) ;
22252231 }
22262232 } else {
22272233 if closing_paren_overflow_max_width || params_last_line_contains_comment {
Original file line number Diff line number Diff line change 1+ // rustfmt-version: Two
2+ fn bar ( _t : T , // bar
3+ ) {
4+ }
You can’t perform that action at this time.
0 commit comments