Skip to content

Change several HashMaps to IndexMap to improve incremental hashing performance #90253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions compiler/rustc_middle/src/middle/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Scope, (Scope, ScopeDepth)>,
pub parent_map: FxIndexMap<Scope, (Scope, ScopeDepth)>,

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

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

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