Auto merge of #93511 - cjgillot:query-copy, r=oli-obk
Ensure that queries only return Copy types. This should pervent the perf footgun of returning a result with an expensive `Clone` impl (like a `Vec` of a hash map). I went for the stupid solution of allocating on an arena everything that was not `Copy`. Some query results could be made Copy easily, but I did not really investigate.
This commit is contained in:
commit
56cd04af5c
27 changed files with 208 additions and 182 deletions
|
@ -477,7 +477,7 @@ pub fn start_async_codegen<B: ExtraBackendMethods>(
|
|||
codegen_worker_receive,
|
||||
shared_emitter_main,
|
||||
future: coordinator_thread,
|
||||
output_filenames: tcx.output_filenames(()),
|
||||
output_filenames: tcx.output_filenames(()).clone(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1050,7 +1050,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
|
|||
cgu_reuse_tracker: sess.cgu_reuse_tracker.clone(),
|
||||
coordinator_send,
|
||||
diag_emitter: shared_emitter.clone(),
|
||||
output_filenames: tcx.output_filenames(()),
|
||||
output_filenames: tcx.output_filenames(()).clone(),
|
||||
regular_module_config: regular_config,
|
||||
metadata_module_config: metadata_config,
|
||||
allocator_module_config: allocator_config,
|
||||
|
|
|
@ -843,7 +843,7 @@ impl CrateInfo {
|
|||
used_crate_source: Default::default(),
|
||||
lang_item_to_crate: Default::default(),
|
||||
missing_lang_items: Default::default(),
|
||||
dependency_formats: tcx.dependency_formats(()),
|
||||
dependency_formats: tcx.dependency_formats(()).clone(),
|
||||
windows_subsystem,
|
||||
};
|
||||
let lang_items = tcx.lang_items();
|
||||
|
@ -860,7 +860,7 @@ impl CrateInfo {
|
|||
info.native_libraries
|
||||
.insert(cnum, tcx.native_libraries(cnum).iter().map(Into::into).collect());
|
||||
info.crate_name.insert(cnum, tcx.crate_name(cnum).to_string());
|
||||
info.used_crate_source.insert(cnum, tcx.used_crate_source(cnum));
|
||||
info.used_crate_source.insert(cnum, tcx.used_crate_source(cnum).clone());
|
||||
if tcx.is_compiler_builtins(cnum) {
|
||||
info.compiler_builtins = Some(cnum);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue