Skip to content

Commit e475a49

Browse files
committed
Change several HashMaps to IndexMap to improve incremental hashing performance
1 parent e91ad5f commit e475a49

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: compiler/rustc_middle/src/middle/region.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/borrow_check.html
88
99
use crate::ty::TyCtxt;
10-
use rustc_data_structures::fx::FxHashMap;
10+
use rustc_data_structures::fx::{FxHashMap, FxIndexMap};
1111
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
1212
use rustc_hir as hir;
1313
use rustc_hir::Node;
@@ -215,14 +215,14 @@ pub struct ScopeTree {
215215
/// conditional expression or repeating block. (Note that the
216216
/// enclosing scope ID for the block associated with a closure is
217217
/// the closure itself.)
218-
pub parent_map: FxHashMap<Scope, (Scope, ScopeDepth)>,
218+
pub parent_map: FxIndexMap<Scope, (Scope, ScopeDepth)>,
219219

220220
/// Maps from a variable or binding ID to the block in which that
221221
/// variable is declared.
222-
var_map: FxHashMap<hir::ItemLocalId, Scope>,
222+
var_map: FxIndexMap<hir::ItemLocalId, Scope>,
223223

224224
/// Maps from a `NodeId` to the associated destruction scope (if any).
225-
destruction_scopes: FxHashMap<hir::ItemLocalId, Scope>,
225+
destruction_scopes: FxIndexMap<hir::ItemLocalId, Scope>,
226226

227227
/// `rvalue_scopes` includes entries for those expressions whose
228228
/// cleanup scope is larger than the default. The map goes from the

0 commit comments

Comments
 (0)