From 74a21425cca6742f08a6df25bb153a3b7a43f56a Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 25 Aug 2024 12:33:55 +0200 Subject: [PATCH] dont iterate over the bitset --- compiler/rustc_const_eval/src/check_consts/check.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_const_eval/src/check_consts/check.rs b/compiler/rustc_const_eval/src/check_consts/check.rs index 13afb1afa828e..9f93776a7b9e2 100644 --- a/compiler/rustc_const_eval/src/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/check_consts/check.rs @@ -289,10 +289,8 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> { if matches!(data.terminator().kind, TerminatorKind::Return) { let location = ccx.body.terminator_loc(bb); maybe_storage_live.seek_after_primary_effect(location); - for local in maybe_storage_live.get().iter() { - // If a local may be live here, it is definitely not transient. - transient.remove(local); - } + // If a local may be live here, it is definitely not transient. + transient.subtract(maybe_storage_live.get()); } }