> On Feb 25, 2014, at 4:04 PM, Eric Reed <[email protected]> wrote:
> 
> Would a &mut that could move enable us to write insertion into a growable 
> data structure that might reallocate itself without unsafe code? Something 
> like OwnedVector.push() for instance.

The problem with that is you need uninitialized memory that you can move in to 
(without running drop glue). I don't see how moving from &mut will help. Even 
if rustc can avoid the drop glue when writing to a &mut that it already moved 
out of, there's no way to construct a pre-moved &mut that points to the 
uninitialized memory (and no way to even create uninitialized memory without 
unsafe).

-Kevin
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to