From cd7a78d9677c6346ab3d859f754ba43de2ad4e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Sun, 10 Dec 2023 00:00:00 +0000 Subject: [PATCH] Remove redundant special case for resume argument The special case is subsumed by the check for always live locals that follows it. --- compiler/rustc_mir_transform/src/coroutine.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/compiler/rustc_mir_transform/src/coroutine.rs b/compiler/rustc_mir_transform/src/coroutine.rs index c4f295d69f8c6..d7dd44af7d251 100644 --- a/compiler/rustc_mir_transform/src/coroutine.rs +++ b/compiler/rustc_mir_transform/src/coroutine.rs @@ -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)