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 <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This commit is contained in:
Daniel Verkamp 2024-10-24 14:09:10 -07:00 committed by crosvm LUCI
parent 17b696fd0a
commit 3f1a383a49
3 changed files with 3 additions and 0 deletions

View file

@ -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) {}
}

View file

@ -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

View file

@ -18,6 +18,7 @@ pub fn create_uffd_for_test() -> Userfaultfd {
}
pub struct SharedMemoryMapping {
#[allow(dead_code)]
pub shm: SharedMemory,
pub mmap: MemoryMapping,
}