|
1 | | -error: usage of an `Arc` that is not `Send` or `Sync` |
| 1 | +error: usage of an `Arc` that is not `Send` and `Sync` |
2 | 2 | --> $DIR/arc_with_non_send_sync.rs:35:13 |
3 | 3 | | |
4 | 4 | LL | let _ = Arc::new(RefCell::new(42)); |
5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
6 | 6 | | |
7 | | - = note: the trait `Sync` is not implemented for `RefCell<i32>` |
8 | | - = note: required for `Arc<RefCell<i32>>` to implement `Send` and `Sync` |
9 | | - = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` |
| 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>` |
10 | 12 | = note: `-D clippy::arc-with-non-send-sync` implied by `-D warnings` |
11 | 13 | = help: to override `-D warnings` add `#[allow(clippy::arc_with_non_send_sync)]` |
12 | 14 |
|
13 | | -error: usage of an `Arc` that is not `Send` or `Sync` |
| 15 | +error: usage of an `Arc` that is not `Send` and `Sync` |
14 | 16 | --> $DIR/arc_with_non_send_sync.rs:40:13 |
15 | 17 | | |
16 | 18 | LL | let _ = Arc::new(mutex.lock().unwrap()); |
17 | 19 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
18 | 20 | | |
19 | | - = note: the trait `Send` is not implemented for `MutexGuard<'_, i32>` |
20 | | - = note: required for `Arc<MutexGuard<'_, i32>>` to implement `Send` and `Sync` |
21 | | - = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` |
| 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>` |
22 | 26 |
|
23 | | -error: usage of an `Arc` that is not `Send` or `Sync` |
| 27 | +error: usage of an `Arc` that is not `Send` and `Sync` |
24 | 28 | --> $DIR/arc_with_non_send_sync.rs:44:13 |
25 | 29 | | |
26 | 30 | LL | let _ = Arc::new(&42 as *const i32); |
27 | 31 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
28 | 32 | | |
29 | | - = note: the trait `Send` is not implemented for `*const i32` |
30 | | - = note: the trait `Sync` is not implemented for `*const i32` |
31 | | - = note: required for `Arc<*const i32>` to implement `Send` and `Sync` |
32 | | - = help: consider using an `Rc` instead or wrapping the inner type with a `Mutex` |
| 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` |
33 | 39 |
|
34 | 40 | error: aborting due to 3 previous errors |
35 | 41 |
|
0 commit comments