Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 297 Bytes

storage_liveness.md

File metadata and controls

13 lines (10 loc) · 297 Bytes

Storage liveness

If you move out from a variable, can you still use the underlying stack space?

{
  let mut x: Vec<u32> = ....;
  let p: *mut Vec<u32> = &mut x;
  drop(x); // compiler can see `x` is uninitialized
        
  // what happens if you use `p` here?
} // StorageDead(x)