Skip to content

Commit 2932e09

Browse files
committed
Simplify creation of a set.
1 parent fda52b8 commit 2932e09

File tree

1 file changed

+1
-3
lines changed
  • compiler/rustc_mir_transform/src

1 file changed

+1
-3
lines changed

compiler/rustc_mir_transform/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,8 @@ fn is_mir_available(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
220220
/// Finds the full set of `DefId`s within the current crate that have
221221
/// MIR associated with them.
222222
fn mir_keys(tcx: TyCtxt<'_>, (): ()) -> FxIndexSet<LocalDefId> {
223-
let mut set = FxIndexSet::default();
224-
225223
// All body-owners have MIR associated with them.
226-
set.extend(tcx.hir().body_owners());
224+
let mut set: FxIndexSet<_> = tcx.hir().body_owners().collect();
227225

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

0 commit comments

Comments
 (0)