Skip to content

Commit 9e86fac

Browse files
jinankjainlauralt
authored andcommitted
virtio-queue: Fix 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 <jinankjain@microsoft.com>
1 parent 86528a9 commit 9e86fac

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

virtio-queue/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ pub trait QueueT: for<'a> QueueGuard<'a> {
154154
///
155155
/// Logically this method will acquire the underlying lock protecting the `Queue` Object.
156156
/// The lock will be released when the returned object gets dropped.
157-
fn lock(&mut self) -> <Self as QueueGuard>::G;
157+
fn lock(&mut self) -> <Self as QueueGuard<'_>>::G;
158158

159159
/// Get the maximum size of the virtio queue.
160160
fn max_size(&self) -> u16;

virtio-queue/src/mock.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,12 @@ impl<'a, M: GuestMemory> MockSplitQueue<'a, M> {
330330
}
331331

332332
/// Available ring accessor.
333-
pub fn avail(&self) -> &AvailRing<M> {
333+
pub fn avail(&self) -> &AvailRing<'_, M> {
334334
&self.avail
335335
}
336336

337337
/// Used ring accessor.
338-
pub fn used(&self) -> &UsedRing<M> {
338+
pub fn used(&self) -> &UsedRing<'_, M> {
339339
&self.used
340340
}
341341

virtio-queue/src/queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ impl QueueT for Queue {
357357
self.event_idx_enabled = false;
358358
}
359359

360-
fn lock(&mut self) -> <Self as QueueGuard>::G {
360+
fn lock(&mut self) -> <Self as QueueGuard<'_>>::G {
361361
self
362362
}
363363

virtio-queue/src/queue_sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub struct QueueSync {
4343
}
4444

4545
impl QueueSync {
46-
fn lock_state(&self) -> MutexGuard<Queue> {
46+
fn lock_state(&self) -> MutexGuard<'_, Queue> {
4747
// Do not expect poisoned lock.
4848
self.state.lock().unwrap()
4949
}
@@ -68,7 +68,7 @@ impl QueueT for QueueSync {
6868
self.lock_state().reset();
6969
}
7070

71-
fn lock(&mut self) -> <Self as QueueGuard>::G {
71+
fn lock(&mut self) -> <Self as QueueGuard<'_>>::G {
7272
self.lock_state()
7373
}
7474

0 commit comments

Comments
 (0)