diff options
| author | pierwill <pierwill@users.noreply.github.com> | 2022-01-06 13:27:59 -0600 |
|---|---|---|
| committer | pierwill <pierwill@users.noreply.github.com> | 2022-01-22 22:34:16 -0600 |
| commit | 4f89224f7f58dd941c9393cf5f85ac619ede8eb2 (patch) | |
| tree | 9c18c3c71b2b5821e4d1b455551d3a974cd141f5 /compiler/rustc_mir_transform/src | |
| parent | 10c4c4afec6dfc483af6efb7019941bab9a51a29 (diff) | |
| download | rust-4f89224f7f58dd941c9393cf5f85ac619ede8eb2.tar.gz rust-4f89224f7f58dd941c9393cf5f85ac619ede8eb2.zip | |
Use an `indexmap` to avoid sorting `LocalDefId`s
Update `indexmap` to 1.8.0. Bless test
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs index bf6f13fa67b..8e1601fb719 100644 --- a/compiler/rustc_mir_transform/src/lib.rs +++ b/compiler/rustc_mir_transform/src/lib.rs @@ -18,7 +18,7 @@ extern crate rustc_middle; use required_consts::RequiredConstsVisitor; use rustc_const_eval::util; -use rustc_data_structures::fx::FxHashSet; +use rustc_data_structures::fx::FxIndexSet; use rustc_data_structures::steal::Steal; use rustc_hir as hir; use rustc_hir::def_id::{DefId, LocalDefId}; @@ -136,8 +136,8 @@ fn is_mir_available(tcx: TyCtxt<'_>, def_id: DefId) -> bool { /// Finds the full set of `DefId`s within the current crate that have /// MIR associated with them. -fn mir_keys(tcx: TyCtxt<'_>, (): ()) -> FxHashSet<LocalDefId> { - let mut set = FxHashSet::default(); +fn mir_keys(tcx: TyCtxt<'_>, (): ()) -> FxIndexSet<LocalDefId> { + let mut set = FxIndexSet::default(); // All body-owners have MIR associated with them. set.extend(tcx.hir().body_owners()); @@ -146,7 +146,7 @@ fn mir_keys(tcx: TyCtxt<'_>, (): ()) -> FxHashSet<LocalDefId> { // they don't have a BodyId, so we need to build them separately. struct GatherCtors<'a, 'tcx> { tcx: TyCtxt<'tcx>, - set: &'a mut FxHashSet<LocalDefId>, + set: &'a mut FxIndexSet<LocalDefId>, } impl<'tcx> Visitor<'tcx> for GatherCtors<'_, 'tcx> { fn visit_variant_data( |
