]> git.lizzy.rs Git - rust.git/blob - src/test/ui/no-reuse-move-arc.stderr
Rollup merge of #97711 - Nilstrieb:rustc-arena-ub, r=wesleywiser
[rust.git] / src / test / ui / no-reuse-move-arc.stderr
1 error[E0382]: borrow of moved value: `arc_v`
2   --> $DIR/no-reuse-move-arc.rs:12:16
3    |
4 LL |     let arc_v = Arc::new(v);
5    |         ----- move occurs because `arc_v` has type `Arc<Vec<i32>>`, which does not implement the `Copy` trait
6 LL |
7 LL |     thread::spawn(move|| {
8    |                   ------ value moved into closure here
9 LL |         assert_eq!((*arc_v)[3], 4);
10    |                      ----- variable moved due to use in closure
11 ...
12 LL |     assert_eq!((*arc_v)[2], 3);
13    |                ^^^^^^^^ value borrowed here after move
14    |
15    = note: borrow occurs due to deref coercion to `Vec<i32>`
16 note: deref defined here
17   --> $SRC_DIR/alloc/src/sync.rs:LL:COL
18    |
19 LL |     type Target = T;
20    |     ^^^^^^^^^^^
21
22 error: aborting due to previous error
23
24 For more information about this error, try `rustc --explain E0382`.