From 8ac561afef6905bd1f708e4d9da2ae0dbc42b1ce Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 4 Oct 2023 21:09:50 +0000 Subject: [PATCH] Fix spans for comments in rustfmt --- src/items.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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),