Hey guys,
I'm really new to Rust (actually I've looked on Rust the last 5 hours the first
time) but I think I produced something that shouldn't be possible. From the
pointer guide I know that the following code will not compile because in the
end I would have two mutable pointers to the same
This is sound- you aren't actually making more than one mutable reference here.
Stepping through the operations in your example:
1. i is a mutable pointer to an immutable memory location
2. Pass a pointer to i into `bar`, which can mutate `i`.
3. Deref that pointer so you have a copy of `i`,
On 26/11/14 12:26 PM, grayfox wrote:
Hey guys,
I'm really new to Rust (actually I've looked on Rust the last 5 hours the
first time) but I think I produced something that shouldn't be possible. From
the pointer guide I know that the following code will not compile because in
the end I