Skip to content

Commit a74db1a

Browse files
Fix another strange suggestion span
1 parent 3a3f4a2 commit a74db1a

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

compiler/rustc_borrowck/src/diagnostics/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
11211121
err.eager_subdiagnostic(
11221122
&self.infcx.tcx.sess.parse_sess.span_diagnostic,
11231123
CaptureReasonSuggest::FreshReborrow {
1124-
span: fn_call_span.shrink_to_lo(),
1124+
span: move_span.shrink_to_hi(),
11251125
});
11261126
}
11271127
if let Some(clone_trait) = tcx.lang_items().clone_trait()

compiler/rustc_borrowck/src/session_diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ pub(crate) enum CaptureReasonSuggest<'tcx> {
398398
#[suggestion(
399399
borrowck_suggest_create_freash_reborrow,
400400
applicability = "maybe-incorrect",
401-
code = "as_mut().",
401+
code = ".as_mut()",
402402
style = "verbose"
403403
)]
404404
FreshReborrow {

tests/ui/moves/pin-mut-reborrow-infer-var-issue-107419.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ note: `Pin::<&'a mut T>::get_mut` takes ownership of the receiver `self`, which
1313
help: consider reborrowing the `Pin` instead of moving it
1414
|
1515
LL | foo(r.as_mut().get_mut());
16-
| +++++++++
16+
| +++++++++
1717

1818
error: aborting due to previous error
1919

tests/ui/moves/pin-mut-reborrow.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LL | fn foo(self: Pin<&mut Self>) {}
1616
help: consider reborrowing the `Pin` instead of moving it
1717
|
1818
LL | foo.as_mut().foo();
19-
| +++++++++
19+
| +++++++++
2020

2121
error: aborting due to previous error
2222

0 commit comments

Comments
 (0)