From 25cba8ea705916c62f1db4dd57b8d2efe62dec14 Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Thu, 28 Sep 2023 12:15:37 +0200 Subject: [PATCH] gpio: drop no-longer required unsafe Send/Sync impls With the refactoring before this commit, `PhysDevice` is `Sync` and `Send` automatically. So let's drop the unsafe impls to prevent future type changes to result in unsound behaviour (again). Fixes: #442 Signed-off-by: Erik Schilling --- crates/vhost-device-gpio/src/gpio.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/crates/vhost-device-gpio/src/gpio.rs b/crates/vhost-device-gpio/src/gpio.rs index 8218ef8..7773aaa 100644 --- a/crates/vhost-device-gpio/src/gpio.rs +++ b/crates/vhost-device-gpio/src/gpio.rs @@ -96,13 +96,6 @@ pub(crate) struct PhysDevice { state: Vec>, } -// SAFETY: Safe as the structure can be sent to another thread. -unsafe impl Send for PhysDevice {} - -// SAFETY: Safe as the structure can be shared with another thread as the state -// is protected with a lock. -unsafe impl Sync for PhysDevice {} - impl GpioDevice for PhysDevice { fn open(device: u32) -> Result where