Skip to content

Commit 8744225

Browse files
committed
Improve MaybeStorageLive::initialize_start_block.
We can union the two sets the easy way. This removes the need for the domain size check, because `union` does that same check itself.
1 parent 3aa236c commit 8744225

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ impl<'a, 'tcx> Analysis<'tcx> for MaybeStorageLive<'a> {
2626
}
2727

2828
fn initialize_start_block(&self, body: &Body<'tcx>, on_entry: &mut Self::Domain) {
29-
assert_eq!(body.local_decls.len(), self.always_live_locals.domain_size());
30-
for local in self.always_live_locals.iter() {
31-
on_entry.insert(local);
32-
}
29+
on_entry.union(self.always_live_locals);
3330

3431
for arg in body.args_iter() {
3532
on_entry.insert(arg);

0 commit comments

Comments
 (0)