Sorry, sent that e-mail prematurely. Short version is that I think we could generalize our move rules somewhat precisely for the purpose of accommodating this situation, but the question is whether it would ultimately be expressive enough. There would have to be rules against making fn calls, reading const pointers, and similar things while borrowed data is in a moved out state. Ultimately, it probably winds up being equivalent to a "multi-swap" primitive, so perhaps that's a better approach anyhow! (Plus it avoids the need to worry about what to do in the case of failure, I haven't really about that before)
Niko On Mon, Sep 02, 2013 at 08:04:17PM -0400, Niko Matsakis wrote: > On Fri, Aug 30, 2013 at 05:50:40PM -0700, Patrick Walton wrote: > > 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. > > One thing that I've been wanting to do is to generalize our move > rules. Currently, we do not permit you to move data from borrowed > locations -- but we COULD safely permit this, under certain > conso long as you > _______________________________________________ > Rust-dev mailing list > Rust-dev@mozilla.org > https://mail.mozilla.org/listinfo/rust-dev _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev