Skip to content

Commit 80ee042

Browse files
committed
stack2reg: Re-add clone() to stop CI
1 parent c62f433 commit 80ee042

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/optimize/stack2reg.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,14 @@ fn remove_unused_stack_addr_and_stack_load(opt_ctx: &mut OptimizeContext<'_>) {
315315

316316
// Replace all unused stack_addr and stack_load instructions with nop.
317317
for stack_slot_users in opt_ctx.stack_slot_usage_map.values_mut() {
318-
while let Some(&inst) = stack_slot_users.stack_addr.iter().next() {
318+
// FIXME: Remove clone
319+
for &inst in stack_slot_users.stack_addr.clone().iter() {
319320
if stack_addr_load_insts_users.get(&inst).map(|users| users.is_empty()).unwrap_or(true) {
320321
stack_slot_users.remove_unused_stack_addr(&mut opt_ctx.ctx.func, inst);
321322
}
322323
}
323324

324-
while let Some(&inst) = stack_slot_users.stack_load.iter().next() {
325+
for &inst in stack_slot_users.stack_load.clone().iter() {
325326
if stack_addr_load_insts_users.get(&inst).map(|users| users.is_empty()).unwrap_or(true) {
326327
stack_slot_users.remove_unused_load(&mut opt_ctx.ctx.func, inst);
327328
}

0 commit comments

Comments
 (0)