|
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, FxIndexMap}; |
11 |
| -use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 10 | +use rustc_data_structures::fx::FxIndexMap; |
| 11 | +use rustc_data_structures::unord::UnordMap; |
12 | 12 | use rustc_hir as hir;
|
13 | 13 | use rustc_hir::{HirIdMap, Node};
|
14 | 14 | use rustc_macros::HashStable;
|
15 |
| -use rustc_query_system::ich::StableHashingContext; |
16 | 15 | use rustc_span::{Span, DUMMY_SP};
|
17 | 16 |
|
18 | 17 | use std::fmt;
|
@@ -205,7 +204,7 @@ impl Scope {
|
205 | 204 | pub type ScopeDepth = u32;
|
206 | 205 |
|
207 | 206 | /// The region scope tree encodes information about region relationships.
|
208 |
| -#[derive(Default, Debug)] |
| 207 | +#[derive(Default, Debug, HashStable)] |
209 | 208 | pub struct ScopeTree {
|
210 | 209 | /// If not empty, this body is the root of this region hierarchy.
|
211 | 210 | pub root_body: Option<hir::HirId>,
|
@@ -306,7 +305,7 @@ pub struct ScopeTree {
|
306 | 305 | /// The reason is that semantically, until the `box` expression returns,
|
307 | 306 | /// the values are still owned by their containing expressions. So
|
308 | 307 | /// we'll see that `&x`.
|
309 |
| - pub yield_in_scope: FxHashMap<Scope, Vec<YieldData>>, |
| 308 | + pub yield_in_scope: UnordMap<Scope, Vec<YieldData>>, |
310 | 309 | }
|
311 | 310 |
|
312 | 311 | /// Identifies the reason that a given expression is an rvalue candidate
|
@@ -404,23 +403,3 @@ impl ScopeTree {
|
404 | 403 | self.yield_in_scope.get(&scope).map(Deref::deref)
|
405 | 404 | }
|
406 | 405 | }
|
407 |
| - |
408 |
| -impl<'a> HashStable<StableHashingContext<'a>> for ScopeTree { |
409 |
| - fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) { |
410 |
| - let ScopeTree { |
411 |
| - root_body, |
412 |
| - ref parent_map, |
413 |
| - ref var_map, |
414 |
| - ref destruction_scopes, |
415 |
| - ref rvalue_candidates, |
416 |
| - ref yield_in_scope, |
417 |
| - } = *self; |
418 |
| - |
419 |
| - root_body.hash_stable(hcx, hasher); |
420 |
| - parent_map.hash_stable(hcx, hasher); |
421 |
| - var_map.hash_stable(hcx, hasher); |
422 |
| - destruction_scopes.hash_stable(hcx, hasher); |
423 |
| - rvalue_candidates.hash_stable(hcx, hasher); |
424 |
| - yield_in_scope.hash_stable(hcx, hasher); |
425 |
| - } |
426 |
| -} |
0 commit comments