From 73019dcec6211fc2bb6d1ed5f603cf1853d68bfb Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Thu, 11 Jul 2024 14:13:18 -0700 Subject: [PATCH] Add #[allow(clippy::arc_with_non_send_sync)] warning: usage of an `Arc` that is not `Send` and `Sync` --> src/lib.rs:66:20 | 66 | inner: Arc::new(inner), | ^^^^^^^^^^^^^^^ | = note: `Arc` is not `Send` and `Sync` as `InnerStarReference` is not `Send` = help: if the `Arc` will not used be across threads replace it with an `Rc` = help: otherwise make `InnerStarReference` `Send` and `Sync` or consider a wrapper type such as `Mutex` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync = note: `#[warn(clippy::arc_with_non_send_sync)]` on by default --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index fc4dd1d..eca6afe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,6 +24,7 @@ struct InnerStarReference { header_view: HeaderView, } +//xxx unsafe impl Send for InnerStarReference {} unsafe impl Sync for InnerStarReference {} impl Drop for InnerStarReference { @@ -62,6 +63,7 @@ impl StarReference { settings, }; + #[allow(clippy::arc_with_non_send_sync)] Ok(StarReference { inner: Arc::new(inner), })