On 11-06-07 09:51 AM, Graydon Hoare wrote:
It's a compromise between "expensive runtime test" and "prohibit all
aliasing of anything shared": only prohibit *deep* aliasing of anything
shared.
As a further caveat: it requires that there be no mutable fields within
the direct referent of the aliased-part of the box. So in a local box
like this:
auto x = @rec(mutable a=10, b=@11, c=12);
passing an alias to x, or x.a, or x.b is prohibited, but x.c is ok.
(Patrick also made a bit of a digression on IRC about the possibility of
having a pattern-binding form &x rather than x to differentiate alt
pattern / destructuring-pattern bindings that copy rather than alias,
but we need rules for aliases that work, so I'm going to avoid derailing
this too much here.)
If you like I'll write this up on a wiki page, to give it a bit more of
a permanent resting/refinement place.
-Graydon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev