From 3f1a383a493c00a7f6595221ee15303146e4ee38 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Thu, 24 Oct 2024 14:09:10 -0700 Subject: [PATCH] Exclude a few dead_code instances These are mostly places where a field in a struct is only kept around for lifetime reasons. Annotating the individual instances means that we don't have to turn off the warning for new code. BUG=b:365852007 Change-Id: I9172ea28cc12779331cd48c2c6ad1003d7ca02f8 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5966505 Commit-Queue: Daniel Verkamp Reviewed-by: Dennis Kempin --- devices/src/register_space/register.rs | 1 + src/crosvm/cmdline.rs | 1 + swap/tests/common/mod.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/devices/src/register_space/register.rs b/devices/src/register_space/register.rs index a61424397d..c5cbe7eb45 100644 --- a/devices/src/register_space/register.rs +++ b/devices/src/register_space/register.rs @@ -131,6 +131,7 @@ pub trait RegisterInterface: Send { /// Handle write. fn write(&self, _addr: RegisterOffset, _data: &[u8]) {} /// Reset this register to default value. + #[allow(dead_code)] fn reset(&self) {} } diff --git a/src/crosvm/cmdline.rs b/src/crosvm/cmdline.rs index a1be479d88..f74e198e58 100644 --- a/src/crosvm/cmdline.rs +++ b/src/crosvm/cmdline.rs @@ -646,6 +646,7 @@ pub struct UsbAttachCommand { arg_name = "BUS_ID:ADDR:BUS_NUM:DEV_NUM", from_str_fn(parse_bus_id_addr) )] + #[allow(dead_code)] pub addr: (u8, u8, u16, u16), #[argh(positional)] /// usb device path diff --git a/swap/tests/common/mod.rs b/swap/tests/common/mod.rs index 3d3afcd8ec..ec62bb9b4d 100644 --- a/swap/tests/common/mod.rs +++ b/swap/tests/common/mod.rs @@ -18,6 +18,7 @@ pub fn create_uffd_for_test() -> Userfaultfd { } pub struct SharedMemoryMapping { + #[allow(dead_code)] pub shm: SharedMemory, pub mmap: MemoryMapping, }