]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_borrowck/src/diagnostics/region_errors.rs
Rollup merge of #105172 - alexs-sh:issue-98861-fix-next, r=scottmcm
[rust.git] / compiler / rustc_borrowck / src / diagnostics / region_errors.rs
index cc33ef14756e5fbda6f1254428dcbf2322c3b5d7..f3050a6ef3f07f7964cf58a23bc3a858dd05b717 100644 (file)
@@ -79,7 +79,7 @@ pub fn new(tcx: TyCtxt<'tcx>) -> Self {
     #[track_caller]
     pub fn push(&mut self, val: impl Into<RegionErrorKind<'tcx>>) {
         let val = val.into();
-        self.1.sess.delay_span_bug(DUMMY_SP, "{val:?}");
+        self.1.sess.delay_span_bug(DUMMY_SP, format!("{val:?}"));
         self.0.push(val);
     }
     pub fn is_empty(&self) -> bool {
@@ -422,7 +422,7 @@ pub(crate) fn report_region_error(
                         );
                         (desc, note)
                     }
-                    _ => panic!("Unexpected type {:?}", ty),
+                    _ => panic!("Unexpected type {ty:?}"),
                 };
                 diag.note(&format!("requirement occurs because of {desc}",));
                 diag.note(&note);
@@ -725,10 +725,10 @@ fn add_static_impl_trait_suggestion(
             let lifetime = if f.has_name() { fr_name.name } else { kw::UnderscoreLifetime };
 
             let arg = match param.param.pat.simple_ident() {
-                Some(simple_ident) => format!("argument `{}`", simple_ident),
+                Some(simple_ident) => format!("argument `{simple_ident}`"),
                 None => "the argument".to_string(),
             };
-            let captures = format!("captures data from {}", arg);
+            let captures = format!("captures data from {arg}");
 
             return nice_region_error::suggest_new_region_bound(
                 self.infcx.tcx,