about summary refs log tree commit diff
path: root/compiler/rustc_incremental/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-07-25 23:04:01 +0200
committerMatthias Krüger <matthias.krueger@famsik.de>2023-07-30 14:22:50 +0200
commit3ce90b16490490aea6da61f913fb0ecbc5d4ec7a (patch)
tree418ea04cfadc1c96e4f0f5ebe99eed489adce1f3 /compiler/rustc_incremental/src
parent2e0136a131f6ed5f6071adf36db08dd8d2205d19 (diff)
downloadrust-3ce90b16490490aea6da61f913fb0ecbc5d4ec7a.tar.gz
rust-3ce90b16490490aea6da61f913fb0ecbc5d4ec7a.zip
inline format!() args up to and including rustc_codegen_llvm
Diffstat (limited to 'compiler/rustc_incremental/src')
-rw-r--r--compiler/rustc_incremental/src/assert_dep_graph.rs10
-rw-r--r--compiler/rustc_incremental/src/persist/dirty_clean.rs2
-rw-r--r--compiler/rustc_incremental/src/persist/fs.rs8
3 files changed, 9 insertions, 11 deletions
diff --git a/compiler/rustc_incremental/src/assert_dep_graph.rs b/compiler/rustc_incremental/src/assert_dep_graph.rs
index 52a84b204d0..5e7ae3ecdb8 100644
--- a/compiler/rustc_incremental/src/assert_dep_graph.rs
+++ b/compiler/rustc_incremental/src/assert_dep_graph.rs
@@ -241,16 +241,16 @@ fn dump_graph(query: &DepGraphQuery) {
 
     {
         // dump a .txt file with just the edges:
-        let txt_path = format!("{}.txt", path);
+        let txt_path = format!("{path}.txt");
         let mut file = BufWriter::new(File::create(&txt_path).unwrap());
         for (source, target) in &edges {
-            write!(file, "{:?} -> {:?}\n", source, target).unwrap();
+            write!(file, "{source:?} -> {target:?}\n").unwrap();
         }
     }
 
     {
         // dump a .dot file in graphviz format:
-        let dot_path = format!("{}.dot", path);
+        let dot_path = format!("{path}.dot");
         let mut v = Vec::new();
         dot::render(&GraphvizDepGraph(nodes, edges), &mut v).unwrap();
         fs::write(dot_path, v).unwrap();
@@ -285,7 +285,7 @@ impl<'a> dot::Labeller<'a> for GraphvizDepGraph {
         dot::Id::new("DependencyGraph").unwrap()
     }
     fn node_id(&self, n: &DepKind) -> dot::Id<'_> {
-        let s: String = format!("{:?}", n)
+        let s: String = format!("{n:?}")
             .chars()
             .map(|c| if c == '_' || c.is_alphanumeric() { c } else { '_' })
             .collect();
@@ -293,7 +293,7 @@ impl<'a> dot::Labeller<'a> for GraphvizDepGraph {
         dot::Id::new(s).unwrap()
     }
     fn node_label(&self, n: &DepKind) -> dot::LabelText<'_> {
-        dot::LabelText::label(format!("{:?}", n))
+        dot::LabelText::label(format!("{n:?}"))
     }
 }
 
diff --git a/compiler/rustc_incremental/src/persist/dirty_clean.rs b/compiler/rustc_incremental/src/persist/dirty_clean.rs
index f9cd01fd80d..5dd06c6ca4f 100644
--- a/compiler/rustc_incremental/src/persist/dirty_clean.rs
+++ b/compiler/rustc_incremental/src/persist/dirty_clean.rs
@@ -300,7 +300,7 @@ impl<'tcx> DirtyCleanVisitor<'tcx> {
             },
             _ => self.tcx.sess.emit_fatal(errors::UndefinedCleanDirty {
                 span: attr.span,
-                kind: format!("{:?}", node),
+                kind: format!("{node:?}"),
             }),
         };
         let labels =
diff --git a/compiler/rustc_incremental/src/persist/fs.rs b/compiler/rustc_incremental/src/persist/fs.rs
index 929a1e149b6..1111a1a17e2 100644
--- a/compiler/rustc_incremental/src/persist/fs.rs
+++ b/compiler/rustc_incremental/src/persist/fs.rs
@@ -427,13 +427,11 @@ fn copy_files(sess: &Session, target_dir: &Path, source_dir: &Path) -> Result<bo
     if sess.opts.unstable_opts.incremental_info {
         eprintln!(
             "[incremental] session directory: \
-                  {} files hard-linked",
-            files_linked
+                  {files_linked} files hard-linked"
         );
         eprintln!(
             "[incremental] session directory: \
-                 {} files copied",
-            files_copied
+                 {files_copied} files copied"
         );
     }
 
@@ -604,7 +602,7 @@ fn crate_path(sess: &Session, crate_name: Symbol, stable_crate_id: StableCrateId
 
     let stable_crate_id = base_n::encode(stable_crate_id.as_u64() as u128, INT_ENCODE_BASE);
 
-    let crate_name = format!("{}-{}", crate_name, stable_crate_id);
+    let crate_name = format!("{crate_name}-{stable_crate_id}");
     incr_dir.join(crate_name)
 }