On 11-07-14 03:08 AM, Marijn Haverbeke wrote:
First, a relatively non-controversial case:

auto&ccx = cx.fcx.lcx.ccx;   // Look ma, no refcounting bumps!

This case is very similar to alt/for blocks, and the alias checker
could check it with a relatively simple extension.

Next, of couse, I'm going to argue that 'accessing things through
blocks', for example the proposed hash table accessor approach (where
you pass a block to the accessor in which you'll have access to the
value) is an abomination, and we should allow functions to return
aliases to the content of their arguments. To the alias checker, this
isn't any more complicated than the alias-in-a-block case, and it is
certainly more pleasant on the programmer.

Thoughts?

I don't understand how the alias checker figures into it. It's a lifetime thing. How do you ensure the aliased value remains live as long as the alias does?

-Graydon
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to