From 8ab2d5e5397a0335c007f200e850f86268783003 Mon Sep 17 00:00:00 2001 From: Yu Li Date: Wed, 12 Jul 2023 14:39:07 +0800 Subject: [PATCH] build: Fix beta clippy issue: private item shadows public glob re-export error: private item shadows public glob re-export Error: --> hypervisor/src/mshv/mod.rs:42:27 | 42 | CpuIdEntry, FpuState, LapicState, MsrEntry, SpecialRegisters, StandardRegisters, | ^^^^^^^^^^ | note: the name `LapicState` in the type namespace is supposed to be publicly re-exported here --> hypervisor/src/mshv/mod.rs:16:9 | 16 | pub use mshv_bindings::*; | ^^^^^^^^^^^^^^^^ note: but the private item here shadows it --> hypervisor/src/mshv/mod.rs:42:27 | 42 | CpuIdEntry, FpuState, LapicState, MsrEntry, SpecialRegisters, StandardRegisters, | ^^^^^^^^^^ = note: `-D hidden-glob-reexports` implied by `-D warnings` Signed-off-by: Yu Li --- hypervisor/src/mshv/mod.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/hypervisor/src/mshv/mod.rs b/hypervisor/src/mshv/mod.rs index 91cf40119..34f204ee8 100644 --- a/hypervisor/src/mshv/mod.rs +++ b/hypervisor/src/mshv/mod.rs @@ -38,9 +38,7 @@ use std::fs::File; use std::os::unix::io::AsRawFd; #[cfg(target_arch = "x86_64")] -use crate::arch::x86::{ - CpuIdEntry, FpuState, LapicState, MsrEntry, SpecialRegisters, StandardRegisters, -}; +use crate::arch::x86::{CpuIdEntry, FpuState, MsrEntry}; const DIRTY_BITMAP_CLEAR_DIRTY: u64 = 0x4; const DIRTY_BITMAP_SET_DIRTY: u64 = 0x8; @@ -314,7 +312,7 @@ impl cpu::Vcpu for MshvVcpu { /// /// Returns the vCPU general purpose registers. /// - fn get_regs(&self) -> cpu::Result { + fn get_regs(&self) -> cpu::Result { Ok(self .fd .get_regs() @@ -325,7 +323,7 @@ impl cpu::Vcpu for MshvVcpu { /// /// Sets the vCPU general purpose registers. /// - fn set_regs(&self, regs: &StandardRegisters) -> cpu::Result<()> { + fn set_regs(&self, regs: &crate::arch::x86::StandardRegisters) -> cpu::Result<()> { let regs = (*regs).into(); self.fd .set_regs(®s) @@ -335,7 +333,7 @@ impl cpu::Vcpu for MshvVcpu { /// /// Returns the vCPU special registers. /// - fn get_sregs(&self) -> cpu::Result { + fn get_sregs(&self) -> cpu::Result { Ok(self .fd .get_sregs() @@ -346,7 +344,7 @@ impl cpu::Vcpu for MshvVcpu { /// /// Sets the vCPU special registers. /// - fn set_sregs(&self, sregs: &SpecialRegisters) -> cpu::Result<()> { + fn set_sregs(&self, sregs: &crate::arch::x86::SpecialRegisters) -> cpu::Result<()> { let sregs = (*sregs).into(); self.fd .set_sregs(&sregs) @@ -603,7 +601,7 @@ impl cpu::Vcpu for MshvVcpu { /// /// Returns the state of the LAPIC (Local Advanced Programmable Interrupt Controller). /// - fn get_lapic(&self) -> cpu::Result { + fn get_lapic(&self) -> cpu::Result { Ok(self .fd .get_lapic() @@ -614,7 +612,7 @@ impl cpu::Vcpu for MshvVcpu { /// /// Sets the state of the LAPIC (Local Advanced Programmable Interrupt Controller). /// - fn set_lapic(&self, lapic: &LapicState) -> cpu::Result<()> { + fn set_lapic(&self, lapic: &crate::arch::x86::LapicState) -> cpu::Result<()> { let lapic: mshv_bindings::LapicState = (*lapic).clone().into(); self.fd .set_lapic(&lapic)