[rust-dev] Mutable files

Patrick Walton pcwalton at mozilla.com
Sun Jul 20 21:04:56 PDT 2014


On 7/20/14 8:12 PM, David Henningsson wrote:
> Cool, thanks for the answer. These restrictions seem somewhat complex.

They are required. Otherwise we would end up with a C++-like situation 
where copies end up happening too frequently.

> This wasn't very intuitive for me, so just throwing this out (feel free
> to ignore if it has already been discussed :-) )
>
>  From a language design perspective, maybe it would be more intuitive to
> have different syntaxes for copy and move, like:

There used to be a unary move operator. This was a huge pain.

     match move x {
         Some(move y) => foo(move z);
     }

And so on. I don't want to go back to that world.

Patrick



More information about the Rust-dev mailing list