Skip to content

Commit

Permalink
Remove redundant special case for resume argument
Browse files Browse the repository at this point in the history
The special case is subsumed by the check for always live locals that
follows it.
  • Loading branch information
tmiasko committed Dec 11, 2023
1 parent ef1831a commit eaaa290
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions compiler/rustc_mir_transform/src/coroutine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1510,13 +1510,6 @@ fn create_cases<'tcx>(

// Create StorageLive instructions for locals with live storage
for i in 0..(body.local_decls.len()) {
if i == 2 {
// The resume argument is live on function entry. Don't insert a
// `StorageLive`, or the following `Assign` will read from uninitialized
// memory.
continue;
}

let l = Local::new(i);
let needs_storage_live = point.storage_liveness.contains(l)
&& !transform.remap.contains_key(&l)
Expand Down

0 comments on commit eaaa290

Please sign in to comment.