On 12/31/13 6:56 AM, Oren Ben-Kiki wrote:
Thanks for the explanation. Of course, the point is that you'd meed two
types, `OnceFn` which is stack-allocated (non-send-able, can take
borrowed pointers from its context) and `SendFn` which is heap-allocated
(send-able, can't take borrowed pointers from its context). Both would
be able to consume an owned pointer.

Well, they're just two *traits*. That's the nice thing about this proposal, in my view: it doesn't require adding any new syntax to the language, only a couple more lang items, which feels like a smaller cognitive burden to me. (It's similar to how our operator overloading feels simpler than C++'s operator overloading, at least to me, because we don't have unique syntax for it.)

Patrick

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

Reply via email to