Skip to content

Commit

Permalink
Fix spans for comments in rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Oct 4, 2023
1 parent 1f079cf commit dd5f26c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tools/rustfmt/src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2599,7 +2599,8 @@ fn rewrite_fn_base(
if where_clause_str.is_empty() {
if let ast::FnRetTy::Default(ret_span) = fd.output {
match recover_missing_comment_in_span(
mk_sp(params_span.hi(), ret_span.hi()),
// from after the closing paren to right before block or semicolon
mk_sp(ret_span.lo(), span.hi()),
shape,
context,
last_line_width(&result),
Expand Down

0 comments on commit dd5f26c

Please sign in to comment.