Sigh, I guess it was too good to be true :-( I'd settle for the ability to say: update_in_place(foo.owned_pointer, &fn(~T) -> ~T) - surely this would be safe?
Speaking of which, a secondary problem I encountered when doing this sort of thing, is the "Once function" issue listed in https://github.com/mozilla/rust/wiki/Doc-under-construction-FAQ. Wouldn't it be possible to say, for example, that ~fn can only be invoked once to resolve this issue? On Sat, Aug 31, 2013 at 3:50 AM, Patrick Walton <[email protected]> wrote: > On 8/30/13 3:39 PM, Patrick Walton wrote: > >> Thoughts? Does this seem useful? Are there soundness issues I didn't >> notice? >> > > Brian pointed out a massive soundness hole in this, unfortunately. The > problem is that you can read from the original locations; the right to read > is not "shut off" during the borrow. I think the fix would have to be to > replace this with some sort of "generalized swap" operation. > > > Patrick > > ______________________________**_________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/**listinfo/rust-dev<https://mail.mozilla.org/listinfo/rust-dev> >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
