1
Fork 0

inline format!() args up to and including rustc_codegen_llvm

This commit is contained in:
Matthias Krüger 2023-07-25 23:04:01 +02:00
parent 2e0136a131
commit 3ce90b1649
72 changed files with 411 additions and 481 deletions

View file

@ -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:?}"))
}
}

View file

@ -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 =

View file

@ -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)
}