|
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; |
@@ -215,14 +215,14 @@ pub struct ScopeTree { |
215 | 215 | /// conditional expression or repeating block. (Note that the |
216 | 216 | /// enclosing scope ID for the block associated with a closure is |
217 | 217 | /// the closure itself.) |
218 | | - pub parent_map: FxHashMap<Scope, (Scope, ScopeDepth)>, |
| 218 | + pub parent_map: FxIndexMap<Scope, (Scope, ScopeDepth)>, |
219 | 219 |
|
220 | 220 | /// Maps from a variable or binding ID to the block in which that |
221 | 221 | /// variable is declared. |
222 | | - var_map: FxHashMap<hir::ItemLocalId, Scope>, |
| 222 | + var_map: FxIndexMap<hir::ItemLocalId, Scope>, |
223 | 223 |
|
224 | 224 | /// 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>, |
226 | 226 |
|
227 | 227 | /// `rvalue_scopes` includes entries for those expressions whose |
228 | 228 | /// cleanup scope is larger than the default. The map goes from the |
|
0 commit comments