1
Fork 0

Fix uninlined_format_args for some compiler crates

Convert all the crates that have had their diagnostic migration
completed (except save_analysis because that will be deleted soon and
apfloat because of the licensing problem).
This commit is contained in:
nils 2022-12-19 10:31:55 +01:00 committed by Nilstrieb
parent 1d284af117
commit fd7a159710
91 changed files with 287 additions and 329 deletions

View file

@ -143,7 +143,7 @@ where
", "
};
write!(f, "{}", delim)?;
write!(f, "{delim}")?;
idx.fmt_with(ctxt, f)?;
first = false;
}
@ -164,7 +164,7 @@ where
", "
};
write!(f, "{}", delim)?;
write!(f, "{delim}")?;
idx.fmt_with(ctxt, f)?;
first = false;
}

View file

@ -71,7 +71,7 @@ where
fn graph_id(&self) -> dot::Id<'_> {
let name = graphviz_safe_def_name(self.body.source.def_id());
dot::Id::new(format!("graph_for_def_id_{}", name)).unwrap()
dot::Id::new(format!("graph_for_def_id_{name}")).unwrap()
}
fn node_id(&self, n: &Self::Node) -> dot::Id<'_> {
@ -190,7 +190,7 @@ where
" cellpadding=\"3\"",
" sides=\"rb\"",
);
write!(w, r#"<table{fmt}>"#, fmt = table_fmt)?;
write!(w, r#"<table{table_fmt}>"#)?;
// A + B: Block header
match self.style {
@ -372,7 +372,7 @@ where
write!(w, concat!("<tr>", r#"<td colspan="2" {fmt}>MIR</td>"#,), fmt = fmt,)?;
for name in state_column_names {
write!(w, "<td {fmt}>{name}</td>", fmt = fmt, name = name)?;
write!(w, "<td {fmt}>{name}</td>")?;
}
write!(w, "</tr>")
@ -394,18 +394,18 @@ where
};
for (i, statement) in body[block].statements.iter().enumerate() {
let statement_str = format!("{:?}", statement);
let index_str = format!("{}", i);
let statement_str = format!("{statement:?}");
let index_str = format!("{i}");
let after = next_in_dataflow_order(&mut afters);
let before = befores.as_mut().map(next_in_dataflow_order);
self.write_row(w, &index_str, &statement_str, |_this, w, fmt| {
if let Some(before) = before {
write!(w, r#"<td {fmt} align="left">{diff}</td>"#, fmt = fmt, diff = before)?;
write!(w, r#"<td {fmt} align="left">{before}</td>"#)?;
}
write!(w, r#"<td {fmt} align="left">{diff}</td>"#, fmt = fmt, diff = after)
write!(w, r#"<td {fmt} align="left">{after}</td>"#)
})?;
}
@ -421,10 +421,10 @@ where
self.write_row(w, "T", &terminator_str, |_this, w, fmt| {
if let Some(before) = before {
write!(w, r#"<td {fmt} align="left">{diff}</td>"#, fmt = fmt, diff = before)?;
write!(w, r#"<td {fmt} align="left">{before}</td>"#)?;
}
write!(w, r#"<td {fmt} align="left">{diff}</td>"#, fmt = fmt, diff = after)
write!(w, r#"<td {fmt} align="left">{after}</td>"#)
})
}

View file

@ -129,13 +129,13 @@ impl<'tcx> fmt::Debug for MovePath<'tcx> {
fn fmt(&self, w: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(w, "MovePath {{")?;
if let Some(parent) = self.parent {
write!(w, " parent: {:?},", parent)?;
write!(w, " parent: {parent:?},")?;
}
if let Some(first_child) = self.first_child {
write!(w, " first_child: {:?},", first_child)?;
write!(w, " first_child: {first_child:?},")?;
}
if let Some(next_sibling) = self.next_sibling {
write!(w, " next_sibling: {:?}", next_sibling)?;
write!(w, " next_sibling: {next_sibling:?}")?;
}
write!(w, " place: {:?} }}", self.place)
}

View file

@ -920,7 +920,7 @@ fn debug_with_context<V: Debug + Eq>(
) -> std::fmt::Result {
for (local, place) in map.locals.iter_enumerated() {
if let Some(place) = place {
debug_with_context_rec(*place, &format!("{:?}", local), new, old, map, f)?;
debug_with_context_rec(*place, &format!("{local:?}"), new, old, map, f)?;
}
}
Ok(())