From e475a49452b5629dac33eee8139d862da7d1dea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sat, 23 Oct 2021 13:50:04 +0200 Subject: [PATCH] Change several HashMaps to IndexMap to improve incremental hashing performance --- compiler/rustc_middle/src/middle/region.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_middle/src/middle/region.rs b/compiler/rustc_middle/src/middle/region.rs index 39ca41c92ff75..eefa665f12246 100644 --- a/compiler/rustc_middle/src/middle/region.rs +++ b/compiler/rustc_middle/src/middle/region.rs @@ -7,7 +7,7 @@ //! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/borrow_check.html use crate::ty::TyCtxt; -use rustc_data_structures::fx::FxHashMap; +use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_hir as hir; use rustc_hir::Node; @@ -215,14 +215,14 @@ pub struct ScopeTree { /// conditional expression or repeating block. (Note that the /// enclosing scope ID for the block associated with a closure is /// the closure itself.) - pub parent_map: FxHashMap, + pub parent_map: FxIndexMap, /// Maps from a variable or binding ID to the block in which that /// variable is declared. - var_map: FxHashMap, + var_map: FxIndexMap, /// Maps from a `NodeId` to the associated destruction scope (if any). - destruction_scopes: FxHashMap, + destruction_scopes: FxIndexMap, /// `rvalue_scopes` includes entries for those expressions whose /// cleanup scope is larger than the default. The map goes from the