@@ -4,38 +4,31 @@ error: usage of an `Arc` that is not `Send` and `Sync`
44LL | let _ = Arc::new(RefCell::new(42));
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
66 |
7- = note: `Arc<RefCell<i32>>` is not `Send` and `Sync` as:
8- = note: - the trait `Sync` is not implemented for `RefCell<i32>`
9- = help: consider using an `Rc` instead. `Arc` does not provide benefits for non `Send` and `Sync` types
10- = note: if you intend to use `Arc` with `Send` and `Sync` traits
11- = note: wrap the inner type with a `Mutex` or implement `Send` and `Sync` for `RefCell<i32>`
7+ = note: `Arc<RefCell<i32>>` is not `Send` and `Sync` as `RefCell<i32>` is not `Sync`
8+ = help: if the `Arc` will not used be across threads replace it with an `Rc`
9+ = help: otherwise make `RefCell<i32>` `Send` and `Sync` or consider a wrapper type such as `Mutex`
1210 = note: `-D clippy::arc-with-non-send-sync` implied by `-D warnings`
1311 = help: to override `-D warnings` add `#[allow(clippy::arc_with_non_send_sync)]`
1412
1513error: usage of an `Arc` that is not `Send` and `Sync`
16- --> tests/ui/arc_with_non_send_sync.rs:40 :13
14+ --> tests/ui/arc_with_non_send_sync.rs:38 :13
1715 |
1816LL | let _ = Arc::new(mutex.lock().unwrap());
1917 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2018 |
21- = note: `Arc<MutexGuard<'_, i32>>` is not `Send` and `Sync` as:
22- = note: - the trait `Send` is not implemented for `MutexGuard<'_, i32>`
23- = help: consider using an `Rc` instead. `Arc` does not provide benefits for non `Send` and `Sync` types
24- = note: if you intend to use `Arc` with `Send` and `Sync` traits
25- = note: wrap the inner type with a `Mutex` or implement `Send` and `Sync` for `MutexGuard<'_, i32>`
19+ = note: `Arc<MutexGuard<'_, i32>>` is not `Send` and `Sync` as `MutexGuard<'_, i32>` is not `Send`
20+ = help: if the `Arc` will not used be across threads replace it with an `Rc`
21+ = help: otherwise make `MutexGuard<'_, i32>` `Send` and `Sync` or consider a wrapper type such as `Mutex`
2622
2723error: usage of an `Arc` that is not `Send` and `Sync`
28- --> tests/ui/arc_with_non_send_sync.rs:44 :13
24+ --> tests/ui/arc_with_non_send_sync.rs:40 :13
2925 |
3026LL | let _ = Arc::new(&42 as *const i32);
3127 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
3228 |
33- = note: `Arc<*const i32>` is not `Send` and `Sync` as:
34- = note: - the trait `Send` is not implemented for `*const i32`
35- = note: - the trait `Sync` is not implemented for `*const i32`
36- = help: consider using an `Rc` instead. `Arc` does not provide benefits for non `Send` and `Sync` types
37- = note: if you intend to use `Arc` with `Send` and `Sync` traits
38- = note: wrap the inner type with a `Mutex` or implement `Send` and `Sync` for `*const i32`
29+ = note: `Arc<*const i32>` is not `Send` and `Sync` as `*const i32` is neither `Send` nor `Sync`
30+ = help: if the `Arc` will not used be across threads replace it with an `Rc`
31+ = help: otherwise make `*const i32` `Send` and `Sync` or consider a wrapper type such as `Mutex`
3932
4033error: aborting due to 3 previous errors
4134
0 commit comments