Skip to content

Commit dd5f26c

Browse files
Fix spans for comments in rustfmt
1 parent 1f079cf commit dd5f26c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tools/rustfmt/src/items.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2599,7 +2599,8 @@ fn rewrite_fn_base(
25992599
if where_clause_str.is_empty() {
26002600
if let ast::FnRetTy::Default(ret_span) = fd.output {
26012601
match recover_missing_comment_in_span(
2602-
mk_sp(params_span.hi(), ret_span.hi()),
2602+
// from after the closing paren to right before block or semicolon
2603+
mk_sp(ret_span.lo(), span.hi()),
26032604
shape,
26042605
context,
26052606
last_line_width(&result),

0 commit comments

Comments
 (0)