From c34fd745077ac158d94eb276843f1186abed0890 Mon Sep 17 00:00:00 2001 From: Patrick Mooney Date: Fri, 29 Nov 2024 11:13:40 -0600 Subject: [PATCH] Fix clippy lints for Rust 1.83 --- bin/propolis-server/src/lib/migrate/mod.rs | 2 +- bin/propolis-server/src/lib/stats/mod.rs | 2 +- crates/nvpair/src/lib.rs | 2 +- lib/propolis/src/hw/ibmpc.rs | 2 +- lib/propolis/src/hw/nvme/queue.rs | 6 +++--- lib/propolis/src/hw/qemu/ramfb.rs | 2 +- lib/propolis/src/util/aspace.rs | 2 +- lib/propolis/src/vmm/mem.rs | 6 ++---- phd-tests/framework/src/test_vm/server.rs | 4 +++- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/propolis-server/src/lib/migrate/mod.rs b/bin/propolis-server/src/lib/migrate/mod.rs index 8a955958e..6ccb6f8fc 100644 --- a/bin/propolis-server/src/lib/migrate/mod.rs +++ b/bin/propolis-server/src/lib/migrate/mod.rs @@ -242,7 +242,7 @@ impl<'a> PageIter<'a> { } } -impl<'a> Iterator for PageIter<'a> { +impl Iterator for PageIter<'_> { type Item = u64; fn next(&mut self) -> Option { while self.current < self.end { diff --git a/bin/propolis-server/src/lib/stats/mod.rs b/bin/propolis-server/src/lib/stats/mod.rs index 750825d49..ccfa10ff0 100644 --- a/bin/propolis-server/src/lib/stats/mod.rs +++ b/bin/propolis-server/src/lib/stats/mod.rs @@ -351,7 +351,7 @@ mod kstat_types { fn as_u64(&self) -> Result; } - impl<'a> ConvertNamedData for NamedData<'a> { + impl ConvertNamedData for NamedData<'_> { fn as_i32(&self) -> Result { unimplemented!() } diff --git a/crates/nvpair/src/lib.rs b/crates/nvpair/src/lib.rs index f08dc6395..f4b4733d0 100644 --- a/crates/nvpair/src/lib.rs +++ b/crates/nvpair/src/lib.rs @@ -180,7 +180,7 @@ pub enum NvName<'a> { Owned(Vec), Loaned(&'a [u8]), } -impl<'a> NvName<'a> { +impl NvName<'_> { pub fn as_ptr(&self) -> *const i8 { match self { NvName::Owned(v) => v.as_ptr().cast(), diff --git a/lib/propolis/src/hw/ibmpc.rs b/lib/propolis/src/hw/ibmpc.rs index af88cdb1e..4d18a4b33 100644 --- a/lib/propolis/src/hw/ibmpc.rs +++ b/lib/propolis/src/hw/ibmpc.rs @@ -2,7 +2,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -/// IO port and IRQ definitions for standard IBM PC hardware +//! IO port and IRQ definitions for standard IBM PC hardware pub const PORT_COM1: u16 = 0x3f8; pub const PORT_COM2: u16 = 0x2f8; diff --git a/lib/propolis/src/hw/nvme/queue.rs b/lib/propolis/src/hw/nvme/queue.rs index 8cb9d74e8..65745bb44 100644 --- a/lib/propolis/src/hw/nvme/queue.rs +++ b/lib/propolis/src/hw/nvme/queue.rs @@ -155,7 +155,7 @@ struct QueueGuard<'a, QS: Debug> { state: MutexGuard<'a, QueueInner>, size: &'a u32, } -impl<'a, QS: Debug> QueueGuard<'a, QS> { +impl QueueGuard<'_, QS> { /// Returns if the queue is currently empty with the given head and tail /// pointers. /// @@ -198,7 +198,7 @@ impl<'a, QS: Debug> QueueGuard<'a, QS> { wrap_sub(*self.size, idx, off) } } -impl<'a> QueueGuard<'a, CompQueueState> { +impl QueueGuard<'_, CompQueueState> { /// Attempt to return the Tail entry pointer and then move it forward by 1. /// /// If the queue is full this method returns [`None`]. @@ -297,7 +297,7 @@ impl SubQueueState { QueueState::new(size, SubQueueState()) } } -impl<'a> QueueGuard<'a, SubQueueState> { +impl QueueGuard<'_, SubQueueState> { /// How many slots are empty between the tail and the head i.e., how many /// entries can we write to the queue currently. fn avail_empty(&self) -> u16 { diff --git a/lib/propolis/src/hw/qemu/ramfb.rs b/lib/propolis/src/hw/qemu/ramfb.rs index 5e68be1dc..2361fae5e 100644 --- a/lib/propolis/src/hw/qemu/ramfb.rs +++ b/lib/propolis/src/hw/qemu/ramfb.rs @@ -299,7 +299,7 @@ pin_project! { since: Instant, } } -impl<'a> Future for UpdatedSince<'a> { +impl Future for UpdatedSince<'_> { type Output = (); fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { diff --git a/lib/propolis/src/util/aspace.rs b/lib/propolis/src/util/aspace.rs index d3cf6f721..57bc49104 100644 --- a/lib/propolis/src/util/aspace.rs +++ b/lib/propolis/src/util/aspace.rs @@ -227,7 +227,7 @@ pub struct InverseIter<'a, T> { end: usize, } -impl<'a, T> Iterator for InverseIter<'a, T> { +impl Iterator for InverseIter<'_, T> { /// Item represents unregistered region in address mapping. type Item = Extent; diff --git a/lib/propolis/src/vmm/mem.rs b/lib/propolis/src/vmm/mem.rs index 054f9e500..370c0a973 100644 --- a/lib/propolis/src/vmm/mem.rs +++ b/lib/propolis/src/vmm/mem.rs @@ -404,9 +404,7 @@ impl SubMapping<'_> { let prot = base.prot; SubMapping { backing: Backing::Base(base), ptr, len, prot } } -} -impl<'a> SubMapping<'a> { /// Acquire a reference to a region of memory within the /// current mapping. /// @@ -1034,7 +1032,7 @@ pub struct MemMany<'a, T: Copy> { pos: usize, phantom: PhantomData, } -impl<'a, T: Copy + FromBytes> GuestData> { +impl GuestData> { /// Gets the object at position `pos` within the memory region. /// /// Returns [`Option::None`] if out of range. @@ -1051,7 +1049,7 @@ impl<'a, T: Copy + FromBytes> GuestData> { } } } -impl<'a, T: Copy + FromBytes> Iterator for GuestData> { +impl Iterator for GuestData> { type Item = GuestData; fn next(&mut self) -> Option { diff --git a/phd-tests/framework/src/test_vm/server.rs b/phd-tests/framework/src/test_vm/server.rs index 92f5fb18b..a1be00a01 100644 --- a/phd-tests/framework/src/test_vm/server.rs +++ b/phd-tests/framework/src/test_vm/server.rs @@ -131,7 +131,9 @@ impl PropolisServer { std::process::Command::new("pfexec") .args(["kill", &pid.to_string()]) .spawn() - .expect("should be able to kill a phd-spawned propolis"); + .expect("should be able to kill a phd-spawned propolis") + .wait() + .expect("kill of phd-spawned propolis was run"); server .wait()