]> git.proxmox.com Git - rustc.git/blob - src/test/ui/no-capture-arc.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / no-capture-arc.rs
1 // error-pattern: borrow 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 }