]> git.lizzy.rs Git - rust.git/blob - src/test/ui/no-reuse-move-arc.rs
Rollup merge of #100479 - compiler-errors:argument-type-error-improvements, r=lcnr
[rust.git] / src / test / ui / no-reuse-move-arc.rs
1 use std::sync::Arc;
2 use std::thread;
3
4 fn main() {
5     let v = vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
6     let arc_v = Arc::new(v);
7
8     thread::spawn(move|| {
9         assert_eq!((*arc_v)[3], 4);
10     });
11
12     assert_eq!((*arc_v)[2], 3); //~ ERROR borrow of moved value: `arc_v`
13
14     println!("{:?}", *arc_v);
15 }