summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_hir/src/definitions.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /compiler/rustc_hir/src/definitions.rs
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_hir/src/definitions.rs')
-rw-r--r--compiler/rustc_hir/src/definitions.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/rustc_hir/src/definitions.rs b/compiler/rustc_hir/src/definitions.rs
index dd37efb69..21cf214e4 100644
--- a/compiler/rustc_hir/src/definitions.rs
+++ b/compiler/rustc_hir/src/definitions.rs
@@ -53,9 +53,8 @@ impl DefPathTable {
//
// 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 @@ impl DefPath {
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 @@ impl DefPath {
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 @@ impl fmt::Display for DefPathData {
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}}}}}"),
}
}
}