]> git.lizzy.rs Git - rust.git/blob - tests/ui/no-capture-arc.rs
Rollup merge of #106734 - albertlarsan68:deny-src-tests-in-tidy, r=Nilstrieb
[rust.git] / tests / 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 }