You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/tools/clippy/clippy_lints/src/arc_with_non_send_sync.rs
+15-7
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,9 @@ declare_clippy_lint! {
14
14
/// This lint warns when you use `Arc` with a type that does not implement `Send` or `Sync`.
15
15
///
16
16
/// ### Why is this bad?
17
-
/// `Arc<T>` is only `Send`/`Sync` when `T` is [both `Send` and `Sync`](https://doc.rust-lang.org/std/sync/struct.Arc.html#impl-Send-for-Arc%3CT%3E),
17
+
/// `Arc<T>` is an Atomic `RC<T>` and guarantees that updates to the reference counter are
18
+
/// Atomic. This is useful in multiprocessing scenarios. To send an `Arc<T>` across processes
19
+
/// and make use of the atomic ref counter, `T` must be [both `Send` and `Sync`](https://doc.rust-lang.org/std/sync/struct.Arc.html#impl-Send-for-Arc%3CT%3E),
18
20
/// either `T` should be made `Send + Sync` or an `Rc` should be used instead of an `Arc`
19
21
///
20
22
/// ### Example
@@ -34,7 +36,7 @@ declare_clippy_lint! {
34
36
#[clippy::version = "1.72.0"]
35
37
pubARC_WITH_NON_SEND_SYNC,
36
38
suspicious,
37
-
"using `Arc` with a type that does not implement `Send` or `Sync`"
39
+
"using `Arc` with a type that does not implement `Send` and `Sync`"
0 commit comments