X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_borrowck%2Fsrc%2Fdiagnostics%2Fconflict_errors.rs;h=eda5588a4d52ec09a04071809ce40de54458fac7;hb=e5e116dca92c7fb2cb0176ee7ff3a9576806b080;hp=d99bfc01a4298ccd50fb8d7fa0adec260065e361;hpb=1e6710da59f8b801bf89641bfcb7795dd6d61ae8;p=rust.git diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs index d99bfc01a42..eda5588a4d5 100644 --- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs @@ -156,7 +156,7 @@ pub(crate) fn report_use_of_moved_or_uninitialized( err.span_note( MultiSpan::from_spans(reinit_spans), &if reinits <= 3 { - format!("these {} reinitializations might get skipped", reinits) + format!("these {reinits} reinitializations might get skipped") } else { format!( "these 3 reinitializations and {} other{} might get skipped", @@ -225,9 +225,8 @@ pub(crate) fn report_use_of_moved_or_uninitialized( err.span_label( span, format!( - "value {} here after {}move", + "value {} here after {partial_str}move", desired_action.as_verb_in_past_tense(), - partial_str ), ); } @@ -257,7 +256,7 @@ pub(crate) fn report_use_of_moved_or_uninitialized( &format!( "consider creating a fresh reborrow of {} here", self.describe_place(moved_place) - .map(|n| format!("`{}`", n)) + .map(|n| format!("`{n}`")) .unwrap_or_else(|| "the mutable reference".to_string()), ), "&mut *", @@ -271,7 +270,7 @@ pub(crate) fn report_use_of_moved_or_uninitialized( DescribePlaceOpt { including_downcast: true, including_tuple_field: true }, ); let note_msg = match opt_name { - Some(name) => format!("`{}`", name), + Some(name) => format!("`{name}`"), None => "value".to_owned(), }; if self.suggest_borrow_fn_like(&mut err, ty, &move_site_vec, ¬e_msg) { @@ -297,9 +296,8 @@ pub(crate) fn report_use_of_moved_or_uninitialized( } = use_spans { err.note(&format!( - "{} occurs due to deref coercion to `{}`", + "{} occurs due to deref coercion to `{deref_target_ty}`", desired_action.as_noun(), - deref_target_ty )); // Check first whether the source is accessible (issue #87060)