misc: Fix missing lifetime syntax clippy warning
This was caught by the nightly compiler during cargo fuzz build.
error: lifetime flowing from input to output with different syntax can be confusing
--> /home/runner/work/cloud-hypervisor/cloud-hypervisor/hypervisor/src/arch/x86/emulator/mod.rs:493:26
|
493 | pub fn new(platform: &mut dyn PlatformEmulator<CpuState = T>) -> Emulator<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ----------- the lifetime gets resolved as `'_`
| |
| this lifetime flows to the output
|
= note: `-D mismatched-lifetime-syntaxes` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(mismatched_lifetime_syntaxes)]`
help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
|
493 | pub fn new(platform: &mut dyn PlatformEmulator<CpuState = T>) -> Emulator<'_, T> {
Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
This commit is contained in:
parent
51002f2bae
commit
2bc8d51a60
12 changed files with 17 additions and 17 deletions
|
|
@ -34,7 +34,7 @@ impl DiskFile for FixedVhdDiskAsync {
|
|||
) as Box<dyn AsyncIo>)
|
||||
}
|
||||
|
||||
fn fd(&mut self) -> BorrowedDiskFd {
|
||||
fn fd(&mut self) -> BorrowedDiskFd<'_> {
|
||||
BorrowedDiskFd::new(self.0.as_raw_fd())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ impl DiskFile for FixedVhdDiskSync {
|
|||
) as Box<dyn AsyncIo>)
|
||||
}
|
||||
|
||||
fn fd(&mut self) -> BorrowedDiskFd {
|
||||
fn fd(&mut self) -> BorrowedDiskFd<'_> {
|
||||
BorrowedDiskFd::new(self.0.as_raw_fd())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ impl<T: Cacheable> CacheMap<T> {
|
|||
self.map.get_mut(&index)
|
||||
}
|
||||
|
||||
pub fn iter_mut(&mut self) -> IterMut<usize, T> {
|
||||
pub fn iter_mut(&mut self) -> IterMut<'_, usize, T> {
|
||||
self.map.iter_mut()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ impl DiskFile for QcowDiskSync {
|
|||
Ok(Box::new(QcowSync::new(self.qcow_file.clone())) as Box<dyn AsyncIo>)
|
||||
}
|
||||
|
||||
fn fd(&mut self) -> BorrowedDiskFd {
|
||||
fn fd(&mut self) -> BorrowedDiskFd<'_> {
|
||||
let lock = self.qcow_file.lock().unwrap();
|
||||
BorrowedDiskFd::new(lock.as_raw_fd())
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ impl QcowSync {
|
|||
}
|
||||
|
||||
impl AsyncAdaptor<QcowFile> for Arc<Mutex<QcowFile>> {
|
||||
fn file(&mut self) -> MutexGuard<QcowFile> {
|
||||
fn file(&mut self) -> MutexGuard<'_, QcowFile> {
|
||||
self.lock().unwrap()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ impl DiskFile for RawFileDisk {
|
|||
}
|
||||
}
|
||||
|
||||
fn fd(&mut self) -> BorrowedDiskFd {
|
||||
fn fd(&mut self) -> BorrowedDiskFd<'_> {
|
||||
BorrowedDiskFd::new(self.file.as_raw_fd())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ impl DiskFile for RawFileDiskAio {
|
|||
}
|
||||
}
|
||||
|
||||
fn fd(&mut self) -> BorrowedDiskFd {
|
||||
fn fd(&mut self) -> BorrowedDiskFd<'_> {
|
||||
BorrowedDiskFd::new(self.file.as_raw_fd())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ impl DiskFile for RawFileDiskSync {
|
|||
}
|
||||
}
|
||||
|
||||
fn fd(&mut self) -> BorrowedDiskFd {
|
||||
fn fd(&mut self) -> BorrowedDiskFd<'_> {
|
||||
BorrowedDiskFd::new(self.file.as_raw_fd())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ impl DiskFile for VhdxDiskSync {
|
|||
)
|
||||
}
|
||||
|
||||
fn fd(&mut self) -> BorrowedDiskFd {
|
||||
fn fd(&mut self) -> BorrowedDiskFd<'_> {
|
||||
let lock = self.vhdx_file.lock().unwrap();
|
||||
BorrowedDiskFd::new(lock.as_raw_fd())
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ impl VhdxSync {
|
|||
}
|
||||
|
||||
impl AsyncAdaptor<Vhdx> for Arc<Mutex<Vhdx>> {
|
||||
fn file(&mut self) -> MutexGuard<Vhdx> {
|
||||
fn file(&mut self) -> MutexGuard<'_, Vhdx> {
|
||||
self.lock().unwrap()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@ macro_rules! gen_handler_match {
|
|||
}
|
||||
|
||||
impl<T: CpuStateManager> Emulator<'_, T> {
|
||||
pub fn new(platform: &mut dyn PlatformEmulator<CpuState = T>) -> Emulator<T> {
|
||||
pub fn new(platform: &mut dyn PlatformEmulator<CpuState = T>) -> Emulator<'_, T> {
|
||||
Emulator { platform }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ pub mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn create_epoll_handler_context(&self) -> EpollHandlerContext {
|
||||
pub fn create_epoll_handler_context(&self) -> EpollHandlerContext<'_> {
|
||||
const QSIZE: u16 = 2;
|
||||
|
||||
let guest_rxvq = GuestQ::new(GuestAddress(0x0010_0000), &self.mem, QSIZE);
|
||||
|
|
|
|||
|
|
@ -74,10 +74,10 @@ impl DeviceTree {
|
|||
pub fn remove(&mut self, k: &str) -> Option<DeviceNode> {
|
||||
self.0.remove(k)
|
||||
}
|
||||
pub fn iter(&self) -> std::collections::hash_map::Iter<String, DeviceNode> {
|
||||
pub fn iter(&self) -> std::collections::hash_map::Iter<'_, String, DeviceNode> {
|
||||
self.0.iter()
|
||||
}
|
||||
pub fn breadth_first_traversal(&self) -> BftIter {
|
||||
pub fn breadth_first_traversal(&self) -> BftIter<'_> {
|
||||
BftIter::new(&self.0)
|
||||
}
|
||||
pub fn pci_devices(&self) -> Vec<&DeviceNode> {
|
||||
|
|
|
|||
|
|
@ -184,12 +184,12 @@ impl Target for GdbStub {
|
|||
type Error = String;
|
||||
|
||||
#[inline(always)]
|
||||
fn base_ops(&mut self) -> BaseOps<Self::Arch, Self::Error> {
|
||||
fn base_ops(&mut self) -> BaseOps<'_, Self::Arch, Self::Error> {
|
||||
BaseOps::MultiThread(self)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn support_breakpoints(&mut self) -> Option<BreakpointsOps<Self>> {
|
||||
fn support_breakpoints(&mut self) -> Option<BreakpointsOps<'_, Self>> {
|
||||
Some(self)
|
||||
}
|
||||
|
||||
|
|
@ -388,7 +388,7 @@ impl MultiThreadSingleStep for GdbStub {
|
|||
|
||||
impl Breakpoints for GdbStub {
|
||||
#[inline(always)]
|
||||
fn support_hw_breakpoint(&mut self) -> Option<HwBreakpointOps<Self>> {
|
||||
fn support_hw_breakpoint(&mut self) -> Option<HwBreakpointOps<'_, Self>> {
|
||||
Some(self)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue