Skip to content

Commit

Permalink
Simplify creation of a set.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Aug 30, 2024
1 parent fda52b8 commit 2932e09
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions compiler/rustc_mir_transform/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,8 @@ fn is_mir_available(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
/// Finds the full set of `DefId`s within the current crate that have
/// MIR associated with them.
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());
let mut set: FxIndexSet<_> = tcx.hir().body_owners().collect();

// Additionally, tuple struct/variant constructors have MIR, but
// they don't have a BodyId, so we need to build them separately.
Expand Down

0 comments on commit 2932e09

Please sign in to comment.