From 585269ecb9c4784ebaa6d5938df23cb7183ff5b0 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Wed, 23 Jun 2021 14:54:20 -0700 Subject: [PATCH] clippy: Address the issue 'field is never read' Issue from beta verion of clippy: error: field is never read: `type` --> vmm/src/cpu.rs:235:5 | 235 | pub r#type: u8, | ^^^^^^^^^^^^^^ | = note: `-D dead-code` implied by `-D warnings` Signed-off-by: Bo Chen --- vmm/src/acpi.rs | 5 +++++ vmm/src/cpu.rs | 3 +++ 2 files changed, 8 insertions(+) diff --git a/vmm/src/acpi.rs b/vmm/src/acpi.rs index 85dd9d7a0..a6b5f28d8 100644 --- a/vmm/src/acpi.rs +++ b/vmm/src/acpi.rs @@ -34,6 +34,7 @@ pub const ACPI_APIC_GENERIC_REDISTRIBUTOR: u8 = 14; #[cfg(target_arch = "aarch64")] pub const ACPI_APIC_GENERIC_TRANSLATOR: u8 = 15; +#[allow(dead_code)] #[repr(packed)] #[derive(Default)] struct PciRangeEntry { @@ -44,6 +45,7 @@ struct PciRangeEntry { _reserved: u32, } +#[allow(dead_code)] #[repr(packed)] #[derive(Default)] struct MemoryAffinity { @@ -60,6 +62,7 @@ struct MemoryAffinity { _reserved3: u64, } +#[allow(dead_code)] #[repr(packed)] #[derive(Default)] struct ProcessorLocalX2ApicAffinity { @@ -109,6 +112,7 @@ impl MemoryAffinity { } } +#[allow(dead_code)] #[repr(packed)] #[derive(Default)] struct ViotVirtioPciNode { @@ -120,6 +124,7 @@ struct ViotVirtioPciNode { _reserved2: [u8; 8], } +#[allow(dead_code)] #[repr(packed)] #[derive(Default)] struct ViotPciRangeNode { diff --git a/vmm/src/cpu.rs b/vmm/src/cpu.rs index 21206cbe1..c8ca75839 100644 --- a/vmm/src/cpu.rs +++ b/vmm/src/cpu.rs @@ -150,6 +150,7 @@ pub enum Error { pub type Result = result::Result; #[cfg(all(target_arch = "x86_64", feature = "acpi"))] +#[allow(dead_code)] #[repr(packed)] struct LocalApic { pub r#type: u8, @@ -159,6 +160,7 @@ struct LocalApic { pub flags: u32, } +#[allow(dead_code)] #[repr(packed)] #[derive(Default)] struct Ioapic { @@ -227,6 +229,7 @@ struct GicIts { pub reserved1: u32, } +#[allow(dead_code)] #[repr(packed)] #[derive(Default)] struct InterruptSourceOverride {