Skip to content

Commit b1b7b94

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 481b5fa commit b1b7b94

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
@@ -28,10 +28,7 @@ impl<'a, 'tcx> Analysis<'tcx> for MaybeStorageLive<'a> {
2828
}
2929

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

3633
for arg in body.args_iter() {
3734
on_entry.insert(arg);

0 commit comments

Comments
 (0)