Skip to content

Commit b5a0503

Browse files
committed
Simplify creation of a set.
1 parent 7036077 commit b5a0503

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
@@ -219,10 +219,8 @@ fn is_mir_available(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
219219
/// Finds the full set of `DefId`s within the current crate that have
220220
/// MIR associated with them.
221221
fn mir_keys(tcx: TyCtxt<'_>, (): ()) -> FxIndexSet<LocalDefId> {
222-
let mut set = FxIndexSet::default();
223-
224222
// All body-owners have MIR associated with them.
225-
set.extend(tcx.hir().body_owners());
223+
let mut set: FxIndexSet<_> = tcx.hir().body_owners().collect();
226224

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

0 commit comments

Comments
 (0)