On 04/06/2011 4:38 AM, Marijn Haverbeke wrote:
(1) Handing out aliases to local variables and function parameters
(directly, not substructures thereof) is always safe. The calling function
is the only one that can possibly provide access its own locals, and it's
suspended for the duration of the call.

Except for upvars. 'for each' bodies can already mess with locals that
were passed by alias to the iterator. We'll want to expand this with
generalized non-escaping lambda.

Upvars-from-lambda-blocks should follow exactly the same rules as the aliases produced by pattern-matching in an alt. That is, locals that are aliased in the scope boundaries between the frame and its lambda-block should be excluded from visibility within the lambda block.

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

Reply via email to