]> git.lizzy.rs Git - rust.git/commitdiff
expand comment in StorageLive
authorRalf Jung <post@ralfj.de>
Sat, 18 May 2019 12:40:17 +0000 (14:40 +0200)
committerRalf Jung <post@ralfj.de>
Sat, 18 May 2019 12:40:53 +0000 (14:40 +0200)
src/librustc_mir/interpret/eval_context.rs

index db827afdb94f4481096d600aa8db0cd5ec599e9d..d4c1e5416d565c50232d271ac1ec800c2c899f3b 100644 (file)
@@ -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 <https://github.com/rust-lang/rust/issues/42371>.
         Ok(mem::replace(&mut self.frame_mut().locals[local].value, local_val))
     }