|
7 | 7 | //! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/borrow_check.html
|
8 | 8 |
|
9 | 9 | use crate::ty::TyCtxt;
|
10 |
| -use rustc_data_structures::fx::FxHashMap; |
| 10 | +use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; |
11 | 11 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
12 | 12 | use rustc_hir as hir;
|
13 | 13 | use rustc_hir::Node;
|
@@ -214,14 +214,14 @@ pub struct ScopeTree {
|
214 | 214 | /// conditional expression or repeating block. (Note that the
|
215 | 215 | /// enclosing scope ID for the block associated with a closure is
|
216 | 216 | /// the closure itself.)
|
217 |
| - pub parent_map: FxHashMap<Scope, (Scope, ScopeDepth)>, |
| 217 | + pub parent_map: FxIndexMap<Scope, (Scope, ScopeDepth)>, |
218 | 218 |
|
219 | 219 | /// Maps from a variable or binding ID to the block in which that
|
220 | 220 | /// variable is declared.
|
221 |
| - var_map: FxHashMap<hir::ItemLocalId, Scope>, |
| 221 | + var_map: FxIndexMap<hir::ItemLocalId, Scope>, |
222 | 222 |
|
223 | 223 | /// Maps from a `NodeId` to the associated destruction scope (if any).
|
224 |
| - destruction_scopes: FxHashMap<hir::ItemLocalId, Scope>, |
| 224 | + destruction_scopes: FxIndexMap<hir::ItemLocalId, Scope>, |
225 | 225 |
|
226 | 226 | /// `rvalue_scopes` includes entries for those expressions whose
|
227 | 227 | /// cleanup scope is larger than the default. The map goes from the
|
|
0 commit comments