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

@ -175,7 +175,7 @@ impl SymbolPath {
fn finish(mut self, hash: u64) -> String {
self.finalize_pending_component();
// E = end name-sequence
let _ = write!(self.result, "17h{:016x}E", hash);
let _ = write!(self.result, "17h{hash:016x}E");
self.result
}
}
@ -227,7 +227,7 @@ impl<'tcx> Printer<'tcx> for &mut SymbolPrinter<'tcx> {
self = self.print_type(ty)?;
self.write_str("; ")?;
if let Some(size) = size.kind().try_to_bits(self.tcx().data_layout.pointer_size) {
write!(self, "{}", size)?
write!(self, "{size}")?
} else if let ty::ConstKind::Param(param) = size.kind() {
self = param.print(self)?
} else {

View file

@ -269,8 +269,7 @@ fn compute_symbol_name<'tcx>(
debug_assert!(
rustc_demangle::try_demangle(&symbol).is_ok(),
"compute_symbol_name: `{}` cannot be demangled",
symbol
"compute_symbol_name: `{symbol}` cannot be demangled"
);
symbol

View file

@ -74,7 +74,7 @@ impl SymbolNamesTest<'_> {
tcx.sess.emit_err(TestOutput {
span: attr.span,
kind: Kind::DemanglingAlt,
content: format!("{:#}", demangling),
content: format!("{demangling:#}"),
});
}
}

View file

@ -126,11 +126,11 @@ fn encode_const<'tcx>(
if value < zero {
s.push('n')
};
let _ = write!(s, "{}", value);
let _ = write!(s, "{value}");
}
fn push_unsigned_value<T: Display>(s: &mut String, value: T) {
let _ = write!(s, "{}", value);
let _ = write!(s, "{value}");
}
if let Some(scalar_int) = c.kind().try_to_scalar_int() {

View file

@ -609,7 +609,7 @@ impl<'tcx> Printer<'tcx> for &mut SymbolMangler<'tcx> {
bits = val.unsigned_abs();
}
let _ = write!(self.out, "{:x}_", bits);
let _ = write!(self.out, "{bits:x}_");
}
// FIXME(valtrees): Remove the special case for `str`
@ -637,7 +637,7 @@ impl<'tcx> Printer<'tcx> for &mut SymbolMangler<'tcx> {
// FIXME(eddyb) use a specialized hex-encoding loop.
for byte in s.bytes() {
let _ = write!(self.out, "{:02x}", byte);
let _ = write!(self.out, "{byte:02x}");
}
self.push("_");