From adf5881757fa68c1b3654afe18b050b1af2b1bab Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 30 Jun 2022 17:34:04 +0100 Subject: [PATCH] build: #[allow(clippy::significant_drop_in_scrutinee) in some crates This check is new in the beta version of clippy and exists to avoid potential deadlocks by highlighting when the test in an if or for loop is something that holds a lock. In many cases we would need to make significant refactorings to be able to pass this check so disable in the affected crates. Signed-off-by: Rob Bradford --- hypervisor/src/lib.rs | 2 ++ vhost_user_block/src/lib.rs | 2 ++ vhost_user_net/src/lib.rs | 2 ++ virtio-devices/src/lib.rs | 2 ++ vm-device/src/lib.rs | 2 ++ vmm/src/lib.rs | 2 ++ 6 files changed, 12 insertions(+) diff --git a/hypervisor/src/lib.rs b/hypervisor/src/lib.rs index c3c422ea0..0ee611863 100644 --- a/hypervisor/src/lib.rs +++ b/hypervisor/src/lib.rs @@ -18,6 +18,8 @@ //! - arm64 //! +#![allow(clippy::significant_drop_in_scrutinee)] + #[macro_use] extern crate anyhow; #[cfg(target_arch = "x86_64")] diff --git a/vhost_user_block/src/lib.rs b/vhost_user_block/src/lib.rs index 639e6a6fe..d1ed43ece 100644 --- a/vhost_user_block/src/lib.rs +++ b/vhost_user_block/src/lib.rs @@ -8,6 +8,8 @@ // // SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause) +#![allow(clippy::significant_drop_in_scrutinee)] + use block_util::{build_disk_image_id, Request, VirtioBlockConfig}; use libc::EFD_NONBLOCK; use log::*; diff --git a/vhost_user_net/src/lib.rs b/vhost_user_net/src/lib.rs index 3f1a6feb8..6ee1d6905 100644 --- a/vhost_user_net/src/lib.rs +++ b/vhost_user_net/src/lib.rs @@ -6,6 +6,8 @@ // // SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause) +#![allow(clippy::significant_drop_in_scrutinee)] + use libc::{self, EFD_NONBLOCK}; use log::*; use net_util::{ diff --git a/virtio-devices/src/lib.rs b/virtio-devices/src/lib.rs index e8c357c51..2c91af91d 100644 --- a/virtio-devices/src/lib.rs +++ b/virtio-devices/src/lib.rs @@ -10,6 +10,8 @@ //! Implements virtio devices, queues, and transport mechanisms. +#![allow(clippy::significant_drop_in_scrutinee)] + #[macro_use] extern crate event_monitor; #[macro_use] diff --git a/vm-device/src/lib.rs b/vm-device/src/lib.rs index c16d0ec4e..326285c7b 100644 --- a/vm-device/src/lib.rs +++ b/vm-device/src/lib.rs @@ -3,6 +3,8 @@ // SPDX-License-Identifier: Apache-2.0 // +#![allow(clippy::significant_drop_in_scrutinee)] + use serde::{Deserialize, Serialize}; mod bus; diff --git a/vmm/src/lib.rs b/vmm/src/lib.rs index 0447ceb91..b531d553b 100644 --- a/vmm/src/lib.rs +++ b/vmm/src/lib.rs @@ -3,6 +3,8 @@ // SPDX-License-Identifier: Apache-2.0 // +#![allow(clippy::significant_drop_in_scrutinee)] + #[macro_use] extern crate event_monitor; #[macro_use]