]> git.lizzy.rs Git - rust.git/blob - src/test/ui/no-capture-arc.rs
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / no-capture-arc.rs
1 // error-pattern: use of moved value
2
3 use std::sync::Arc;
4 use std::thread;
5
6 fn main() {
7     let v = vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
8     let arc_v = Arc::new(v);
9
10     thread::spawn(move|| {
11         assert_eq!((*arc_v)[3], 4);
12     });
13
14     assert_eq!((*arc_v)[2], 3);
15
16     println!("{:?}", *arc_v);
17 }