From: Ralf Jung Date: Sat, 18 May 2019 12:40:17 +0000 (+0200) Subject: expand comment in StorageLive X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=a226b53b585d824f2268811894aa08e2495bc025;p=rust.git expand comment in StorageLive --- diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs index db827afdb94..d4c1e5416d5 100644 --- a/src/librustc_mir/interpret/eval_context.rs +++ b/src/librustc_mir/interpret/eval_context.rs @@ -613,7 +613,9 @@ pub fn storage_live( trace!("{:?} is now live", local); let local_val = LocalValue::Uninitialized; - // StorageLive *always* kills the value that's currently stored + // StorageLive *always* kills the value that's currently stored. + // However, we do not error if the variable already is live; + // see . Ok(mem::replace(&mut self.frame_mut().locals[local].value, local_val)) }