diff options
| author | bors <bors@rust-lang.org> | 2023-06-08 07:30:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-06-08 07:30:03 +0000 |
| commit | a0df04c0f2b9c0415c53e3cee8c4f9fa394a37b2 (patch) | |
| tree | 0be6a55d83be0af20c6a73a5b7981cad8483d5f1 /compiler/rustc_codegen_ssa/src/back | |
| parent | 80917360d350fb55aebf383e7ff99efea41f63fd (diff) | |
| parent | 3f324a8b7d62f44f97ba76eeb76b67d6ff0bf744 (diff) | |
Auto merge of #110040 - ndrewxie:issue-84447-partial-1, r=lcnr,michaelwoerister
Removed use of iteration through a HashMap/HashSet in rustc_incremental and replaced with IndexMap/IndexSet This allows for the `#[allow(rustc::potential_query_instability)]` in rustc_incremental to be removed, moving towards fixing #84447 (although a LOT more modules have to be changed to fully resolve it). Only HashMaps/HashSets that are being iterated through have been modified (although many structs and traits outside of rustc_incremental had to be modified as well, as they had fields/methods that involved a HashMap/HashSet that would be iterated through) I'm making a PR for just 1 module changed to test for performance regressions and such, for future changes I'll either edit this PR to reflect additional modules being converted, or batch multiple modules of changes together and make a PR for each group of modules.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/write.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index 10e9e5588f6..701d0d73ad3 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -9,7 +9,7 @@ use crate::{ }; use jobserver::{Acquired, Client}; use rustc_ast::attr; -use rustc_data_structures::fx::FxHashMap; +use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; use rustc_data_structures::memmap::Mmap; use rustc_data_structures::profiling::SelfProfilerRef; use rustc_data_structures::profiling::TimingGuard; @@ -498,8 +498,8 @@ pub fn start_async_codegen<B: ExtraBackendMethods>( fn copy_all_cgu_workproducts_to_incr_comp_cache_dir( sess: &Session, compiled_modules: &CompiledModules, -) -> FxHashMap<WorkProductId, WorkProduct> { - let mut work_products = FxHashMap::default(); +) -> FxIndexMap<WorkProductId, WorkProduct> { + let mut work_products = FxIndexMap::default(); if sess.opts.incremental.is_none() { return work_products; @@ -1885,7 +1885,7 @@ pub struct OngoingCodegen<B: ExtraBackendMethods> { } impl<B: ExtraBackendMethods> OngoingCodegen<B> { - pub fn join(self, sess: &Session) -> (CodegenResults, FxHashMap<WorkProductId, WorkProduct>) { + pub fn join(self, sess: &Session) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) { let _timer = sess.timer("finish_ongoing_codegen"); self.shared_emitter_main.check(sess, true); |
