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:
parent
1d284af117
commit
fd7a159710
91 changed files with 287 additions and 329 deletions
|
@ -526,7 +526,7 @@ fn collect_items_rec<'tcx>(
|
|||
let formatted_item = with_no_trimmed_paths!(starting_point.node.to_string());
|
||||
tcx.sess.span_note_without_error(
|
||||
starting_point.span,
|
||||
&format!("the above error was encountered while instantiating `{}`", formatted_item),
|
||||
&format!("the above error was encountered while instantiating `{formatted_item}`"),
|
||||
);
|
||||
}
|
||||
inlining_map.lock_mut().record_accesses(starting_point.node, &neighbors.items);
|
||||
|
|
|
@ -50,7 +50,7 @@ impl IntoDiagnostic<'_> for UnusedGenericParams {
|
|||
// FIXME: I can figure out how to do a label with a fluent string with a fixed message,
|
||||
// or a label with a dynamic value in a hard-coded string, but I haven't figured out
|
||||
// how to combine the two. 😢
|
||||
diag.span_label(span, format!("generic parameter `{}` is unused", name));
|
||||
diag.span_label(span, format!("generic parameter `{name}` is unused"));
|
||||
}
|
||||
diag
|
||||
}
|
||||
|
|
|
@ -285,7 +285,7 @@ where
|
|||
use std::fmt::Write;
|
||||
|
||||
let s = &mut String::new();
|
||||
let _ = writeln!(s, "{}", label);
|
||||
let _ = writeln!(s, "{label}");
|
||||
for cgu in cgus {
|
||||
let _ =
|
||||
writeln!(s, "CodegenUnit {} estimated size {} :", cgu.name(), cgu.size_estimate());
|
||||
|
@ -355,9 +355,8 @@ fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> (&DefIdSet, &[Co
|
|||
} else {
|
||||
if mode_string != "lazy" {
|
||||
let message = format!(
|
||||
"Unknown codegen-item collection mode '{}'. \
|
||||
Falling back to 'lazy' mode.",
|
||||
mode_string
|
||||
"Unknown codegen-item collection mode '{mode_string}'. \
|
||||
Falling back to 'lazy' mode."
|
||||
);
|
||||
tcx.sess.warn(&message);
|
||||
}
|
||||
|
@ -470,7 +469,7 @@ fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> (&DefIdSet, &[Co
|
|||
item_keys.sort();
|
||||
|
||||
for item in item_keys {
|
||||
println!("MONO_ITEM {}", item);
|
||||
println!("MONO_ITEM {item}");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -596,6 +595,6 @@ pub fn provide(providers: &mut Providers) {
|
|||
let (_, all) = tcx.collect_and_partition_mono_items(());
|
||||
all.iter()
|
||||
.find(|cgu| cgu.name() == name)
|
||||
.unwrap_or_else(|| panic!("failed to find cgu with name {:?}", name))
|
||||
.unwrap_or_else(|| panic!("failed to find cgu with name {name:?}"))
|
||||
};
|
||||
}
|
||||
|
|
|
@ -40,12 +40,12 @@ pub(crate) fn dump_closure_profile<'tcx>(tcx: TyCtxt<'tcx>, closure_instance: In
|
|||
let new_size = tcx
|
||||
.layout_of(param_env.and(after_feature_tys))
|
||||
.map(|l| format!("{:?}", l.size.bytes()))
|
||||
.unwrap_or_else(|e| format!("Failed {:?}", e));
|
||||
.unwrap_or_else(|e| format!("Failed {e:?}"));
|
||||
|
||||
let old_size = tcx
|
||||
.layout_of(param_env.and(before_feature_tys))
|
||||
.map(|l| format!("{:?}", l.size.bytes()))
|
||||
.unwrap_or_else(|e| format!("Failed {:?}", e));
|
||||
.unwrap_or_else(|e| format!("Failed {e:?}"));
|
||||
|
||||
let closure_span = tcx.def_span(closure_def_id);
|
||||
let src_file = tcx.sess.source_map().span_to_filename(closure_span);
|
||||
|
@ -54,7 +54,7 @@ pub(crate) fn dump_closure_profile<'tcx>(tcx: TyCtxt<'tcx>, closure_instance: In
|
|||
.source_map()
|
||||
.span_to_lines(closure_span)
|
||||
.map(|l| format!("{:?} {:?}", l.lines.first(), l.lines.last()))
|
||||
.unwrap_or_else(|e| format!("{:?}", e));
|
||||
.unwrap_or_else(|e| format!("{e:?}"));
|
||||
|
||||
if let Err(e) = writeln!(
|
||||
file,
|
||||
|
@ -64,7 +64,7 @@ pub(crate) fn dump_closure_profile<'tcx>(tcx: TyCtxt<'tcx>, closure_instance: In
|
|||
src_file.prefer_local(),
|
||||
line_nos
|
||||
) {
|
||||
eprintln!("Error writing to file {}", e)
|
||||
eprintln!("Error writing to file {e}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue