summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_borrowck/src/diagnostics/region_name.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_borrowck/src/diagnostics/region_name.rs')
-rw-r--r--compiler/rustc_borrowck/src/diagnostics/region_name.rs14
1 files changed, 5 insertions, 9 deletions
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:?}",
);
}
}