2012-05-23 17:46:43 -05:00
|
|
|
import comm::*;
|
|
|
|
|
|
|
|
fn main() {
|
2012-06-25 22:00:46 -05:00
|
|
|
let v = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]/~;
|
2012-05-23 17:46:43 -05:00
|
|
|
let arc_v = arc::arc(v);
|
2012-05-24 15:35:57 -05:00
|
|
|
|
|
|
|
task::spawn() {|move arc_v| //! NOTE move of variable occurred here
|
2012-05-23 17:46:43 -05:00
|
|
|
let v = *arc::get(&arc_v);
|
|
|
|
assert v[3] == 4;
|
|
|
|
};
|
|
|
|
|
2012-05-24 15:35:57 -05:00
|
|
|
assert (*arc::get(&arc_v))[2] == 3; //! ERROR use of moved variable: `arc_v`
|
2012-05-23 17:46:43 -05:00
|
|
|
|
|
|
|
log(info, arc_v);
|
|
|
|
}
|