1
Fork 0

Auto merge of #94062 - Mark-Simulacrum:drop-print-cfg, r=oli-obk

Move ty::print methods to Drop-based scope guards

Primary goal is reducing codegen of the TLS access for each closure, which shaves ~3 seconds of bootstrap time over rustc as a whole.
This commit is contained in:
bors 2022-02-20 18:12:59 +00:00
commit 523a1b1d38
30 changed files with 142 additions and 142 deletions

View file

@ -454,7 +454,7 @@ fn collect_items_rec<'tcx>(
&& starting_point.node.krate() != LOCAL_CRATE
&& starting_point.node.is_user_defined()
{
let formatted_item = with_no_trimmed_paths(|| starting_point.node.to_string());
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),

View file

@ -425,7 +425,7 @@ fn collect_and_partition_mono_items<'tcx>(
let mut item_keys: Vec<_> = items
.iter()
.map(|i| {
let mut output = with_no_trimmed_paths(|| i.to_string());
let mut output = with_no_trimmed_paths!(i.to_string());
output.push_str(" @@");
let mut empty = Vec::new();
let cgus = item_to_cgus.get_mut(i).unwrap_or(&mut empty);