mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-23 19:43:20 +00:00
34 lines
1.6 KiB
Text
34 lines
1.6 KiB
Text
error: usage of an `Arc` that is not `Send` and `Sync`
|
|
--> tests/ui/arc_with_non_send_sync.rs:35:13
|
|
|
|
|
LL | let _ = Arc::new(RefCell::new(42));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `Arc<RefCell<i32>>` is not `Send` and `Sync` as `RefCell<i32>` is not `Sync`
|
|
= help: if the `Arc` will not used be across threads replace it with an `Rc`
|
|
= help: otherwise make `RefCell<i32>` `Send` and `Sync` or consider a wrapper type such as `Mutex`
|
|
= note: `-D clippy::arc-with-non-send-sync` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::arc_with_non_send_sync)]`
|
|
|
|
error: usage of an `Arc` that is not `Send` and `Sync`
|
|
--> tests/ui/arc_with_non_send_sync.rs:38:13
|
|
|
|
|
LL | let _ = Arc::new(mutex.lock().unwrap());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `Arc<MutexGuard<'_, i32>>` is not `Send` and `Sync` as `MutexGuard<'_, i32>` is not `Send`
|
|
= help: if the `Arc` will not used be across threads replace it with an `Rc`
|
|
= help: otherwise make `MutexGuard<'_, i32>` `Send` and `Sync` or consider a wrapper type such as `Mutex`
|
|
|
|
error: usage of an `Arc` that is not `Send` and `Sync`
|
|
--> tests/ui/arc_with_non_send_sync.rs:40:13
|
|
|
|
|
LL | let _ = Arc::new(&42 as *const i32);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `Arc<*const i32>` is not `Send` and `Sync` as `*const i32` is neither `Send` nor `Sync`
|
|
= help: if the `Arc` will not used be across threads replace it with an `Rc`
|
|
= help: otherwise make `*const i32` `Send` and `Sync` or consider a wrapper type such as `Mutex`
|
|
|
|
error: aborting due to 3 previous errors
|
|
|