match def_key.disambiguated_data.data {
DefPathData::CrateRoot => {
- crate_name = self.tcx.original_crate_name(def_id.krate).as_str();
+ crate_name = self.tcx.crate_name(def_id.krate).as_str();
name = &*crate_name;
dis = "";
end_index = 3;
// need to invoke queries itself, we cannot keep the query caches
// locked while doing so. Instead we copy out the
// `(query_key, dep_node_index)` pairs and release the lock again.
- let query_keys_and_indices: Vec<_> = query_cache
- .iter_results(|results| results.map(|(k, _, i)| (k.clone(), i)).collect());
+ let mut query_keys_and_indices = Vec::new();
+ query_cache.iter_results(&mut |k, _, i| query_keys_and_indices.push((k.clone(), i)));
// Now actually allocate the strings. If allocating the strings
// generates new entries in the query cache, we'll miss them but
let query_name = profiler.get_or_alloc_cached_string(query_name);
let event_id = event_id_builder.from_label(query_name).to_string_id();
- query_cache.iter_results(|results| {
- let query_invocation_ids: Vec<_> = results.map(|v| v.2.into()).collect();
-
- profiler.bulk_map_query_invocation_id_to_single_string(
- query_invocation_ids.into_iter(),
- event_id,
- );
+ let mut query_invocation_ids = Vec::new();
+ query_cache.iter_results(&mut |_, _, i| {
+ query_invocation_ids.push(i.into());
});
+
+ profiler.bulk_map_query_invocation_id_to_single_string(
+ query_invocation_ids.into_iter(),
+ event_id,
+ );
}
});
}