From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_borrowck/src/diagnostics/region_name.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'compiler/rustc_borrowck/src/diagnostics/region_name.rs') diff --git a/compiler/rustc_borrowck/src/diagnostics/region_name.rs b/compiler/rustc_borrowck/src/diagnostics/region_name.rs index 171e62d91..9233287cf 100644 --- a/compiler/rustc_borrowck/src/diagnostics/region_name.rs +++ b/compiler/rustc_borrowck/src/diagnostics/region_name.rs @@ -200,9 +200,9 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> { /// increment the counter. /// /// This is _not_ idempotent. Call `give_region_a_name` when possible. - fn synthesize_region_name(&self) -> Symbol { + pub(crate) fn synthesize_region_name(&self) -> Symbol { let c = self.next_region_name.replace_with(|counter| *counter + 1); - Symbol::intern(&format!("'{:?}", c)) + Symbol::intern(&format!("'{c:?}")) } /// Maps from an internal MIR region vid to something that we can @@ -493,10 +493,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> { // // & // - let's call the lifetime of this reference `'1` - ( - ty::Ref(region, referent_ty, _), - hir::TyKind::Rptr(_lifetime, referent_hir_ty), - ) => { + (ty::Ref(region, referent_ty, _), hir::TyKind::Ref(_lifetime, referent_hir_ty)) => { if region.to_region_vid() == needle_fr { // Just grab the first character, the `&`. let source_map = self.infcx.tcx.sess.source_map(); @@ -622,7 +619,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> { // programs, so we need to use delay_span_bug here. See #82126. self.infcx.tcx.sess.delay_span_bug( hir_arg.span(), - &format!("unmatched subst and hir arg: found {:?} vs {:?}", kind, hir_arg), + &format!("unmatched subst and hir arg: found {kind:?} vs {hir_arg:?}"), ); } } @@ -786,8 +783,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> { } else { span_bug!( hir_ty.span, - "bounds from lowered return type of async fn did not match expected format: {:?}", - opaque_ty + "bounds from lowered return type of async fn did not match expected format: {opaque_ty:?}", ); } } -- cgit v1.2.3