File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
compiler/rustc_mir/src/transform/inline Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 11use rustc_data_structures::fx::{FxHashMap, FxHashSet};
2+ use rustc_data_structures::sso::SsoHashSet;
23use rustc_data_structures::stack::ensure_sufficient_stack;
34use rustc_hir::def_id::{DefId, LocalDefId};
45use rustc_middle::mir::TerminatorKind;
@@ -140,7 +141,7 @@ crate fn mir_inliner_callees<'tcx>(
140141 // Functions from other crates and MIR shims
141142 _ => tcx.instance_mir(instance),
142143 };
143- let mut calls = Vec ::new();
144+ let mut calls = SsoHashSet ::new();
144145 for bb_data in body.basic_blocks() {
145146 let terminator = bb_data.terminator();
146147 if let TerminatorKind::Call { func, .. } = &terminator.kind {
@@ -149,12 +150,8 @@ crate fn mir_inliner_callees<'tcx>(
149150 ty::FnDef(def_id, substs) => (*def_id, *substs),
150151 _ => continue,
151152 };
152- // We've seen this before
153- if calls.contains(&call) {
154- continue;
155- }
156- calls.push(call);
153+ calls.insert(call);
157154 }
158155 }
159- tcx.arena.alloc_slice(& calls)
156+ tcx.arena.alloc_from_iter( calls.iter().copied() )
160157}
You can’t perform that action at this time.
0 commit comments