Fix another strange suggestion span

This commit is contained in:
Michael Goulet 2023-06-22 21:32:39 +00:00
parent 3a3f4a2144
commit a74db1abb3
4 changed files with 4 additions and 4 deletions

View File

@ -1121,7 +1121,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
err.eager_subdiagnostic( err.eager_subdiagnostic(
&self.infcx.tcx.sess.parse_sess.span_diagnostic, &self.infcx.tcx.sess.parse_sess.span_diagnostic,
CaptureReasonSuggest::FreshReborrow { CaptureReasonSuggest::FreshReborrow {
span: fn_call_span.shrink_to_lo(), span: move_span.shrink_to_hi(),
}); });
} }
if let Some(clone_trait) = tcx.lang_items().clone_trait() if let Some(clone_trait) = tcx.lang_items().clone_trait()

View File

@ -398,7 +398,7 @@ pub(crate) enum CaptureReasonSuggest<'tcx> {
#[suggestion( #[suggestion(
borrowck_suggest_create_freash_reborrow, borrowck_suggest_create_freash_reborrow,
applicability = "maybe-incorrect", applicability = "maybe-incorrect",
code = "as_mut().", code = ".as_mut()",
style = "verbose" style = "verbose"
)] )]
FreshReborrow { FreshReborrow {

View File

@ -13,7 +13,7 @@ note: `Pin::<&'a mut T>::get_mut` takes ownership of the receiver `self`, which
help: consider reborrowing the `Pin` instead of moving it help: consider reborrowing the `Pin` instead of moving it
| |
LL | foo(r.as_mut().get_mut()); LL | foo(r.as_mut().get_mut());
| +++++++++ | +++++++++
error: aborting due to previous error error: aborting due to previous error

View File

@ -16,7 +16,7 @@ LL | fn foo(self: Pin<&mut Self>) {}
help: consider reborrowing the `Pin` instead of moving it help: consider reborrowing the `Pin` instead of moving it
| |
LL | foo.as_mut().foo(); LL | foo.as_mut().foo();
| +++++++++ | +++++++++
error: aborting due to previous error error: aborting due to previous error