2023-11-07 22:34:36 +00:00
|
|
|
error: usage of an `Arc` that is not `Send` and `Sync`
|
2023-07-31 21:53:53 +00:00
|
|
|
--> $DIR/arc_with_non_send_sync.rs:35:13
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
2023-07-17 08:19:29 +00:00
|
|
|
LL | let _ = Arc::new(RefCell::new(42));
|
2023-07-02 12:35:19 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-11-07 22:34:36 +00:00
|
|
|
= note: `Arc<RefCell<i32>>` is not `Send` and `Sync` as:
|
|
|
|
= note: - the trait `Sync` is not implemented for `RefCell<i32>`
|
|
|
|
= help: consider using an `Rc` instead. `Arc` does not provide benefits for non `Send` and `Sync` types
|
|
|
|
= note: if you intend to use `Arc` with `Send` and `Sync` traits
|
|
|
|
= note: wrap the inner type with a `Mutex` or implement `Send` and `Sync` for `RefCell<i32>`
|
2023-07-02 12:35:19 +00:00
|
|
|
= note: `-D clippy::arc-with-non-send-sync` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::arc_with_non_send_sync)]`
|
2023-07-02 12:35:19 +00:00
|
|
|
|
2023-11-07 22:34:36 +00:00
|
|
|
error: usage of an `Arc` that is not `Send` and `Sync`
|
2023-07-31 21:53:53 +00:00
|
|
|
--> $DIR/arc_with_non_send_sync.rs:40:13
|
2023-07-17 08:19:29 +00:00
|
|
|
|
|
|
|
|
LL | let _ = Arc::new(mutex.lock().unwrap());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-11-07 22:34:36 +00:00
|
|
|
= note: `Arc<MutexGuard<'_, i32>>` is not `Send` and `Sync` as:
|
|
|
|
= note: - the trait `Send` is not implemented for `MutexGuard<'_, i32>`
|
|
|
|
= help: consider using an `Rc` instead. `Arc` does not provide benefits for non `Send` and `Sync` types
|
|
|
|
= note: if you intend to use `Arc` with `Send` and `Sync` traits
|
|
|
|
= note: wrap the inner type with a `Mutex` or implement `Send` and `Sync` for `MutexGuard<'_, i32>`
|
2023-07-17 08:19:29 +00:00
|
|
|
|
2023-11-07 22:34:36 +00:00
|
|
|
error: usage of an `Arc` that is not `Send` and `Sync`
|
2023-07-31 21:53:53 +00:00
|
|
|
--> $DIR/arc_with_non_send_sync.rs:44:13
|
2023-07-17 08:19:29 +00:00
|
|
|
|
|
|
|
|
LL | let _ = Arc::new(&42 as *const i32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-11-07 22:34:36 +00:00
|
|
|
= note: `Arc<*const i32>` is not `Send` and `Sync` as:
|
|
|
|
= note: - the trait `Send` is not implemented for `*const i32`
|
|
|
|
= note: - the trait `Sync` is not implemented for `*const i32`
|
|
|
|
= help: consider using an `Rc` instead. `Arc` does not provide benefits for non `Send` and `Sync` types
|
|
|
|
= note: if you intend to use `Arc` with `Send` and `Sync` traits
|
|
|
|
= note: wrap the inner type with a `Mutex` or implement `Send` and `Sync` for `*const i32`
|
2023-07-17 08:19:29 +00:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2023-07-02 12:35:19 +00:00
|
|
|
|