@@ -4,38 +4,31 @@ error: usage of an `Arc` that is not `Send` and `Sync`
4
4
LL | let _ = Arc::new(RefCell::new(42));
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
|
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`
12
10
= note: `-D clippy::arc-with-non-send-sync` implied by `-D warnings`
13
11
= help: to override `-D warnings` add `#[allow(clippy::arc_with_non_send_sync)]`
14
12
15
13
error: 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
17
15
|
18
16
LL | let _ = Arc::new(mutex.lock().unwrap());
19
17
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20
18
|
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`
26
22
27
23
error: 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
29
25
|
30
26
LL | let _ = Arc::new(&42 as *const i32);
31
27
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
32
28
|
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`
39
32
40
33
error: aborting due to 3 previous errors
41
34
0 commit comments