2012-05-23 15:46:43 -07:00
|
|
|
// error-pattern: copying a noncopyable value
|
|
|
|
|
2012-09-11 17:46:20 -07:00
|
|
|
extern mod std;
|
2012-09-05 12:32:05 -07:00
|
|
|
use std::arc;
|
|
|
|
use comm::*;
|
2012-05-23 15:46:43 -07:00
|
|
|
|
|
|
|
fn main() {
|
2012-06-29 16:26:56 -07:00
|
|
|
let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
2012-08-29 14:45:25 -07:00
|
|
|
let arc_v = arc::ARC(v);
|
2012-05-23 15:46:43 -07:00
|
|
|
|
2012-07-04 15:04:28 -04:00
|
|
|
do task::spawn() {
|
2012-05-23 15:46:43 -07:00
|
|
|
let v = *arc::get(&arc_v);
|
|
|
|
assert v[3] == 4;
|
|
|
|
};
|
|
|
|
|
|
|
|
assert (*arc::get(&arc_v))[2] == 3;
|
|
|
|
|
|
|
|
log(info, arc_v);
|
|
|
|
}
|