Closed
Description
The following code segfaults in both 0.6 and the current incoming:
struct A { t: bool }
fn main() {
let mut a = ~A { t: false };
let f = || { a.t = true; };
let mut x = a;
f();
x.t = false; // not strictly required but ignores an warning
}
The cause is that a
was moved to x
and f
(created before the movement) was unable to deduce that a
has been moved. Ideally such code should not compile.