Use fmt named parameters in rustc_borrowck

This commit is contained in:
wcampbell
2023-01-06 19:34:45 -05:00
parent 0fb8b72ce4
commit d0cf7e3bf5
9 changed files with 63 additions and 92 deletions

View File

@@ -264,7 +264,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
ProjectionElem::Deref,
],
} => {
err.span_label(span, format!("cannot {ACT}", ACT = act));
err.span_label(span, format!("cannot {act}"));
if let Some(span) = get_mut_span_in_struct_field(
self.infcx.tcx,
@@ -290,7 +290,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
.unwrap_or(false) =>
{
let decl = &self.body.local_decls[local];
err.span_label(span, format!("cannot {ACT}", ACT = act));
err.span_label(span, format!("cannot {act}"));
if let Some(mir::Statement {
source_info,
kind:
@@ -634,7 +634,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
}
PlaceRef { local: _, projection: [.., ProjectionElem::Deref] } => {
err.span_label(span, format!("cannot {ACT}", ACT = act));
err.span_label(span, format!("cannot {act}"));
match opt_source {
Some(BorrowedContentSource::OverloadedDeref(ty)) => {
@@ -1207,7 +1207,7 @@ fn suggest_ampmut<'tcx>(
{
let lt_name = &src[1..ws_pos];
let ty = &src[ws_pos..];
return (true, highlight_span, format!("&{} mut{}", lt_name, ty));
return (true, highlight_span, format!("&{lt_name} mut{ty}"));
}
let ty_mut = local_decl.ty.builtin_deref(true).unwrap();