about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-10-04 21:09:50 +0000
committerMichael Goulet <michael@errs.io>2023-10-04 21:09:54 +0000
commit8ac561afef6905bd1f708e4d9da2ae0dbc42b1ce (patch)
tree2b46bb28aacbae54f7635d9db15e6d2402fffe6e
parentb8e3cb0377f1e2ccb77fa050a3b4c362dfdff045 (diff)
downloadrust-8ac561afef6905bd1f708e4d9da2ae0dbc42b1ce.tar.gz
rust-8ac561afef6905bd1f708e4d9da2ae0dbc42b1ce.zip
Fix spans for comments in rustfmt
-rw-r--r--src/items.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/items.rs b/src/items.rs
index d5bc38303e0..002cffa9b0c 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -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),