about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-08-28 08:24:20 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-08-30 10:30:57 +1000
commit2932e097f49901bd46dca835ff7a6ac000a94876 (patch)
treecfa1a60d7408a641e2e6d13ba99d2914114ef4bf /compiler/rustc_mir_transform/src
parentfda52b8f63db5a2530f245e15b8a5695a929e886 (diff)
downloadrust-2932e097f49901bd46dca835ff7a6ac000a94876.tar.gz
rust-2932e097f49901bd46dca835ff7a6ac000a94876.zip
Simplify creation of a set.
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/lib.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs
index ddefc1307d8..0289c32cdcf 100644
--- a/compiler/rustc_mir_transform/src/lib.rs
+++ b/compiler/rustc_mir_transform/src/lib.rs
@@ -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.