Given a situation like #149861 where we emit
error[E0382]: use of moved value: `results`
--> src/main.rs:30:22
|
22 | let results = Arc::new(Mutex::new(Vec::new()));
| ------- move occurs because `results` has type `Arc<std::sync::Mutex<Vec<i32>>>`, which does not implement the `Copy` trait
...
28 | for i in 0..20 {
| -------------- inside of this loop
29 | // let results = Arc::clone(&results);
30 | pool.execute(move || {
| ^^^^^^^ value moved into closure here, in previous iteration of loop
31 | let mut r = results.lock().unwrap();
| ------- use occurs due to use in closure
...
we should have a way of annotating Arc to explain that even though it isn't Copy, you can cheaply clone it.
Given a situation like #149861 where we emit
we should have a way of annotating
Arcto explain that even though it isn'tCopy, you can cheaply clone it.