Skip to content

Commit

Permalink
Prefer UnordSet over FxHashSet where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Apr 2, 2024
1 parent e2cf2cb commit b4993c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_mir_transform/src/coroutine/by_move_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! be a coroutine body that takes all of its upvars by-move, and which we stash
//! into the `CoroutineInfo` for all coroutines returned by coroutine-closures.

use rustc_data_structures::fx::FxIndexSet;
use rustc_data_structures::unord::UnordSet;
use rustc_hir as hir;
use rustc_middle::mir::visit::MutVisitor;
use rustc_middle::mir::{self, dump_mir, MirPass};
Expand Down Expand Up @@ -33,7 +33,7 @@ impl<'tcx> MirPass<'tcx> for ByMoveBody {
return;
}

let mut by_ref_fields = FxIndexSet::default();
let mut by_ref_fields = UnordSet::default();
let by_move_upvars = Ty::new_tup_from_iter(
tcx,
tcx.closure_captures(coroutine_def_id).iter().enumerate().map(|(idx, capture)| {
Expand Down Expand Up @@ -73,7 +73,7 @@ impl<'tcx> MirPass<'tcx> for ByMoveBody {

struct MakeByMoveBody<'tcx> {
tcx: TyCtxt<'tcx>,
by_ref_fields: FxIndexSet<FieldIdx>,
by_ref_fields: UnordSet<FieldIdx>,
by_move_coroutine_ty: Ty<'tcx>,
}

Expand Down

0 comments on commit b4993c4

Please sign in to comment.