[rust-dev] Futures in Rust
vadimcn at gmail.com
Wed Jan 29 14:39:01 PST 2014
I've tried to simulate that with iterators, but it seems I can still read
the buffer. This compiles without errors:
let mut buf = [0, ..1024];
let mut iter = buf.mut_iter();
let x = buf;
*iter.next().unwrap() = 2; // just to make sure I can mutate via the
On Wed, Jan 29, 2014 at 2:06 PM, Daniel Micay <danielmicay at gmail.com> wrote:
> On Wed, Jan 29, 2014 at 5:03 PM, Vadim <vadimcn at gmail.com> wrote:
> > But maybe Rust type system could grow a new type of borrow that prevents
> > object access while it is in scope, similarly to how iterators prevent
> > mutation of the container being iterated?
> > Vadim
> An `&mut` borrow will prevent reads not through that borrow.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rust-dev