Skip to content

Commit 9a744c2

Browse files
jinankjainstefano-garzarella
authored andcommitted
vhost: Fix clippy warning from nightly compiler
There is a new warning reported by nightly compiler about mismatched lifetime syntaxes. Add the missing lifetime where ever required. Signed-off-by: Jinank Jain <[email protected]>
1 parent 49afe46 commit 9a744c2

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

vhost-user-backend/src/bitmap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl Bitmap for BitmapMmapRegion {
8787
.is_some_and(|bitmap| bitmap.dirty_at(self.base_address.saturating_add(offset)))
8888
}
8989

90-
fn slice_at(&self, offset: usize) -> <Self as WithBitmapSlice>::S {
90+
fn slice_at(&self, offset: usize) -> <Self as WithBitmapSlice<'_>>::S {
9191
Self {
9292
inner: Arc::clone(&self.inner),
9393
base_address: self.base_address.saturating_add(offset),

vhost-user-backend/src/vring.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ pub struct VringMutex<M: GuestAddressSpace = GuestMemoryAtomic<GuestMemoryMmap>>
275275

276276
impl<M: GuestAddressSpace> VringMutex<M> {
277277
/// Get a mutable guard to the underlying raw `VringState` object.
278-
fn lock(&self) -> MutexGuard<VringState<M>> {
278+
fn lock(&self) -> MutexGuard<'_, VringState<M>> {
279279
self.state.lock().unwrap()
280280
}
281281
}
@@ -295,11 +295,11 @@ impl<M: 'static + GuestAddressSpace> VringT<M> for VringMutex<M> {
295295
})
296296
}
297297

298-
fn get_ref(&self) -> <Self as VringStateGuard<M>>::G {
298+
fn get_ref(&self) -> <Self as VringStateGuard<'_, M>>::G {
299299
self.state.lock().unwrap()
300300
}
301301

302-
fn get_mut(&self) -> <Self as VringStateMutGuard<M>>::G {
302+
fn get_mut(&self) -> <Self as VringStateMutGuard<'_, M>>::G {
303303
self.lock()
304304
}
305305

@@ -390,7 +390,7 @@ pub struct VringRwLock<M: GuestAddressSpace = GuestMemoryAtomic<GuestMemoryMmap>
390390

391391
impl<M: GuestAddressSpace> VringRwLock<M> {
392392
/// Get a mutable guard to the underlying raw `VringState` object.
393-
fn write_lock(&self) -> RwLockWriteGuard<VringState<M>> {
393+
fn write_lock(&self) -> RwLockWriteGuard<'_, VringState<M>> {
394394
self.state.write().unwrap()
395395
}
396396
}
@@ -410,11 +410,11 @@ impl<M: 'static + GuestAddressSpace> VringT<M> for VringRwLock<M> {
410410
})
411411
}
412412

413-
fn get_ref(&self) -> <Self as VringStateGuard<M>>::G {
413+
fn get_ref(&self) -> <Self as VringStateGuard<'_, M>>::G {
414414
self.state.read().unwrap()
415415
}
416416

417-
fn get_mut(&self) -> <Self as VringStateMutGuard<M>>::G {
417+
fn get_mut(&self) -> <Self as VringStateMutGuard<'_, M>>::G {
418418
self.write_lock()
419419
}
420420

vhost/src/vhost_user/backend_req.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl Backend {
9797
}
9898
}
9999

100-
fn node(&self) -> MutexGuard<BackendInternal> {
100+
fn node(&self) -> MutexGuard<'_, BackendInternal> {
101101
self.node.lock().unwrap()
102102
}
103103

vhost/src/vhost_user/gpu_backend_req.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl GpuBackend {
117117
}
118118
}
119119

120-
fn node(&self) -> MutexGuard<BackendInternal> {
120+
fn node(&self) -> MutexGuard<'_, BackendInternal> {
121121
self.node.lock().unwrap()
122122
}
123123

0 commit comments

Comments
 (0)