X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_hir%2Fsrc%2Fdefinitions.rs;h=21cf214e47c50d13535d11c2847b5ed4bce82e2a;hb=c6a104f3e4266cb9f369b7edbc58520ca43f911e;hp=dd37efb6983b429e5db6869e707662775ec444c3;hpb=adb8ba3cfe8e3ebf5d6b60858dd18fcc3375b6d4;p=rust.git diff --git a/compiler/rustc_hir/src/definitions.rs b/compiler/rustc_hir/src/definitions.rs index dd37efb6983..21cf214e47c 100644 --- a/compiler/rustc_hir/src/definitions.rs +++ b/compiler/rustc_hir/src/definitions.rs @@ -53,9 +53,8 @@ fn allocate(&mut self, key: DefKey, def_path_hash: DefPathHash) -> DefIndex { // // See the documentation for DefPathHash for more information. panic!( - "found DefPathHash collision between {:?} and {:?}. \ - Compilation cannot continue.", - def_path1, def_path2 + "found DefPathHash collision between {def_path1:?} and {def_path2:?}. \ + Compilation cannot continue." ); } @@ -224,7 +223,7 @@ pub fn to_string_no_crate_verbose(&self) -> String { let mut s = String::with_capacity(self.data.len() * 16); for component in &self.data { - write!(s, "::{}", component).unwrap(); + write!(s, "::{component}").unwrap(); } s @@ -240,7 +239,7 @@ pub fn to_filename_friendly_no_crate(&self) -> String { for component in &self.data { s.extend(opt_delimiter); opt_delimiter = Some('-'); - write!(s, "{}", component).unwrap(); + write!(s, "{component}").unwrap(); } s @@ -433,7 +432,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.name() { DefPathDataName::Named(name) => f.write_str(name.as_str()), // FIXME(#70334): this will generate legacy {{closure}}, {{impl}}, etc - DefPathDataName::Anon { namespace } => write!(f, "{{{{{}}}}}", namespace), + DefPathDataName::Anon { namespace } => write!(f, "{{{{{namespace}}}}}"), } } }