Skip to content

Commit d4a4c1d

Browse files
Make iteration order of named_variable_map, late_bound_vars_map, and resolve_bound_vars queries stable
1 parent d189d3e commit d4a4c1d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

compiler/rustc_middle/src/middle/resolve_bound_vars.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::ty;
44

5-
use rustc_data_structures::fx::FxHashMap;
5+
use rustc_data_structures::fx::FxIndexMap;
66
use rustc_errors::ErrorGuaranteed;
77
use rustc_hir::def_id::DefId;
88
use rustc_hir::{ItemLocalId, OwnerId};
@@ -51,7 +51,7 @@ pub enum ObjectLifetimeDefault {
5151
pub struct ResolveBoundVars {
5252
/// Maps from every use of a named (not anonymous) lifetime to a
5353
/// `Region` describing how that region is bound
54-
pub defs: FxHashMap<OwnerId, FxHashMap<ItemLocalId, ResolvedArg>>,
54+
pub defs: FxIndexMap<OwnerId, FxIndexMap<ItemLocalId, ResolvedArg>>,
5555

56-
pub late_bound_vars: FxHashMap<OwnerId, FxHashMap<ItemLocalId, Vec<ty::BoundVariableKind>>>,
56+
pub late_bound_vars: FxIndexMap<OwnerId, FxIndexMap<ItemLocalId, Vec<ty::BoundVariableKind>>>,
5757
}

compiler/rustc_middle/src/query/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,7 @@ rustc_queries! {
16671667
desc { "resolving lifetimes" }
16681668
}
16691669
query named_variable_map(_: hir::OwnerId) ->
1670-
Option<&'tcx FxHashMap<ItemLocalId, ResolvedArg>> {
1670+
Option<&'tcx FxIndexMap<ItemLocalId, ResolvedArg>> {
16711671
desc { "looking up a named region" }
16721672
}
16731673
query is_late_bound_map(_: hir::OwnerId) -> Option<&'tcx FxIndexSet<ItemLocalId>> {
@@ -1683,7 +1683,7 @@ rustc_queries! {
16831683
separate_provide_extern
16841684
}
16851685
query late_bound_vars_map(_: hir::OwnerId)
1686-
-> Option<&'tcx FxHashMap<ItemLocalId, Vec<ty::BoundVariableKind>>> {
1686+
-> Option<&'tcx FxIndexMap<ItemLocalId, Vec<ty::BoundVariableKind>>> {
16871687
desc { "looking up late bound vars" }
16881688
}
16891689

0 commit comments

Comments
 (0)