mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: keep lifetime consistent from input to output
Cargo fuzz build report an error:
error: lifetime flowing from input to output with different syntax can be confusing
--> /home/runner/work/cloud-hypervisor/cloud-hypervisor/block/src/lib.rs:747:13
|
747 | fn file(&mut self) -> MutexGuard<F>;
| ^^^^^^^^^ ------------- the lifetime gets resolved as `'_`
| |
| this lifetime flows to the output
error: lifetime flowing from input to output with different syntax can be confusing
--> /home/runner/work/cloud-hypervisor/cloud-hypervisor/block/src/async_io.rs:68:11
|
68 | fn fd(&mut self) -> BorrowedDiskFd;
| ^^^^^^^^^ -------------- the lifetime gets resolved as `'_`
| |
| this lifetime flows to the output
Signed-off-by: Yi Wang <foxywang@tencent.com>
This commit is contained in:
@@ -65,7 +65,7 @@ pub trait DiskFile: Send {
|
|||||||
///
|
///
|
||||||
/// The file descriptor is supposed to be used for `fcntl()` calls but no
|
/// The file descriptor is supposed to be used for `fcntl()` calls but no
|
||||||
/// other operation.
|
/// other operation.
|
||||||
fn fd(&mut self) -> BorrowedDiskFd;
|
fn fd(&mut self) -> BorrowedDiskFd<'_>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
|
|||||||
@@ -744,7 +744,7 @@ where
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn file(&mut self) -> MutexGuard<F>;
|
fn file(&mut self) -> MutexGuard<'_, F>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum ImageType {
|
pub enum ImageType {
|
||||||
|
|||||||
Reference in New Issue
Block a user