diff --git a/vulkano/src/buffer/cpu_access.rs b/vulkano/src/buffer/cpu_access.rs index c2ee90270..fc73e54c0 100644 --- a/vulkano/src/buffer/cpu_access.rs +++ b/vulkano/src/buffer/cpu_access.rs @@ -295,7 +295,7 @@ where /// that uses it in exclusive mode will fail. You can still submit this buffer for non-exclusive /// accesses (ie. reads). #[inline] - pub fn read(&self) -> Result, ReadLockError> { + pub fn read(&self) -> Result, ReadLockError> { let mut state = self.inner.state(); let buffer_range = self.inner().offset..self.inner().offset + self.size(); @@ -336,7 +336,7 @@ where /// After this function successfully locks the buffer, any attempt to submit a command buffer /// that uses it and any attempt to call `read()` will return an error. #[inline] - pub fn write(&self) -> Result, WriteLockError> { + pub fn write(&self) -> Result, WriteLockError> { let mut state = self.inner.state(); let buffer_range = self.inner().offset..self.inner().offset + self.size(); @@ -371,7 +371,7 @@ where A: Send + Sync, { #[inline] - fn inner(&self) -> BufferInner { + fn inner(&self) -> BufferInner<'_> { BufferInner { buffer: &self.inner, offset: 0, @@ -450,7 +450,7 @@ where #[derive(Debug)] pub struct ReadLock<'a, T, A> where - T: BufferContents + ?Sized + 'a, + T: BufferContents + ?Sized, A: MemoryPoolAlloc, { inner: &'a CpuAccessibleBuffer, @@ -492,7 +492,7 @@ where #[derive(Debug)] pub struct WriteLock<'a, T, A> where - T: BufferContents + ?Sized + 'a, + T: BufferContents + ?Sized, A: MemoryPoolAlloc, { inner: &'a CpuAccessibleBuffer, @@ -559,7 +559,7 @@ impl Error for ReadLockError {} impl Display for ReadLockError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", @@ -588,7 +588,7 @@ impl Error for WriteLockError {} impl Display for WriteLockError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", diff --git a/vulkano/src/buffer/cpu_pool.rs b/vulkano/src/buffer/cpu_pool.rs index b4bec3ba5..4b7dbcb1c 100644 --- a/vulkano/src/buffer/cpu_pool.rs +++ b/vulkano/src/buffer/cpu_pool.rs @@ -419,7 +419,7 @@ where // `cur_buf_mutex` must be an active lock of `self.current_buffer`. fn reset_buf( &self, - cur_buf_mutex: &mut MutexGuard>>>, + cur_buf_mutex: &mut MutexGuard<'_, Option>>>, capacity: DeviceSize, ) -> Result<(), DeviceMemoryError> { let size = match (size_of::() as DeviceSize).checked_mul(capacity) { @@ -478,7 +478,7 @@ where // fn try_next_impl( &self, - cur_buf_mutex: &mut MutexGuard>>>, + cur_buf_mutex: &mut MutexGuard<'_, Option>>>, data: I, ) -> Result, I::IntoIter> where @@ -688,7 +688,7 @@ where A: MemoryPool, { #[inline] - fn inner(&self) -> BufferInner { + fn inner(&self) -> BufferInner<'_> { BufferInner { buffer: &self.buffer.inner, offset: self.index * size_of::() as DeviceSize + self.align_offset, @@ -810,7 +810,7 @@ where A: MemoryPool, { #[inline] - fn inner(&self) -> BufferInner { + fn inner(&self) -> BufferInner<'_> { self.chunk.inner() } diff --git a/vulkano/src/buffer/device_local.rs b/vulkano/src/buffer/device_local.rs index 9d9d669f8..9e27c4e48 100644 --- a/vulkano/src/buffer/device_local.rs +++ b/vulkano/src/buffer/device_local.rs @@ -493,7 +493,7 @@ where A: Send + Sync, { #[inline] - fn inner(&self) -> BufferInner { + fn inner(&self) -> BufferInner<'_> { BufferInner { buffer: &self.inner, offset: 0, @@ -573,7 +573,7 @@ impl Error for DeviceLocalBufferCreationError { impl Display for DeviceLocalBufferCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::DeviceMemoryAllocationError(err) => err.fmt(f), Self::CommandBufferBeginError(err) => err.fmt(f), diff --git a/vulkano/src/buffer/slice.rs b/vulkano/src/buffer/slice.rs index 8a5466af2..ac44ab644 100644 --- a/vulkano/src/buffer/slice.rs +++ b/vulkano/src/buffer/slice.rs @@ -213,7 +213,7 @@ where T: Send + Sync + ?Sized, { #[inline] - fn inner(&self) -> BufferInner { + fn inner(&self) -> BufferInner<'_> { let inner = self.resource.inner(); BufferInner { buffer: inner.buffer, diff --git a/vulkano/src/buffer/sys.rs b/vulkano/src/buffer/sys.rs index d2811d66f..d9448f5b1 100644 --- a/vulkano/src/buffer/sys.rs +++ b/vulkano/src/buffer/sys.rs @@ -446,7 +446,7 @@ impl UnsafeBuffer { Ok(()) } - pub(crate) fn state(&self) -> MutexGuard { + pub(crate) fn state(&self) -> MutexGuard<'_, BufferState> { self.state.lock() } @@ -601,7 +601,7 @@ impl Error for BufferCreationError { impl Display for BufferCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::AllocError(_) => write!(f, "allocating memory failed"), Self::RequirementNotMet { diff --git a/vulkano/src/buffer/traits.rs b/vulkano/src/buffer/traits.rs index e3f36352e..2c3b1bb99 100644 --- a/vulkano/src/buffer/traits.rs +++ b/vulkano/src/buffer/traits.rs @@ -24,7 +24,7 @@ use std::{ /// See also `TypedBufferAccess`. pub unsafe trait BufferAccess: DeviceOwned + Send + Sync { /// Returns the inner information about this buffer. - fn inner(&self) -> BufferInner; + fn inner(&self) -> BufferInner<'_>; /// Returns the size of the buffer in bytes. fn size(&self) -> DeviceSize; @@ -142,7 +142,7 @@ where T::Target: BufferAccess, { #[inline] - fn inner(&self) -> BufferInner { + fn inner(&self) -> BufferInner<'_> { (**self).inner() } @@ -175,7 +175,7 @@ where } impl Debug for dyn BufferAccess { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { f.debug_struct("dyn BufferAccess") .field("inner", &self.inner()) .finish() @@ -214,7 +214,7 @@ impl Error for BufferDeviceAddressError {} impl Display for BufferDeviceAddressError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::RequirementNotMet { required_for, diff --git a/vulkano/src/buffer/view.rs b/vulkano/src/buffer/view.rs index 67feac10f..4a55507c7 100644 --- a/vulkano/src/buffer/view.rs +++ b/vulkano/src/buffer/view.rs @@ -370,7 +370,7 @@ impl Error for BufferViewCreationError { impl Display for BufferViewCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::OomError(_) => write!( f, diff --git a/vulkano/src/command_buffer/auto.rs b/vulkano/src/command_buffer/auto.rs index 5ac8f3f28..a8e0acfd7 100644 --- a/vulkano/src/command_buffer/auto.rs +++ b/vulkano/src/command_buffer/auto.rs @@ -543,7 +543,7 @@ impl Error for CommandBufferBeginError { impl Display for CommandBufferBeginError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::OomError(_) => write!(f, "not enough memory available"), @@ -686,7 +686,7 @@ impl Error for BuildError { } impl Display for BuildError { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::OomError(_) => write!(f, "out of memory"), Self::RenderPassActive => { @@ -712,7 +712,7 @@ impl AutoCommandBufferBuilder { /// Returns the binding/setting state. #[inline] - pub fn state(&self) -> CommandBufferState { + pub fn state(&self) -> CommandBufferState<'_> { self.inner.state() } } diff --git a/vulkano/src/command_buffer/commands/bind_push.rs b/vulkano/src/command_buffer/commands/bind_push.rs index 2bad6bb33..13fe748f0 100644 --- a/vulkano/src/command_buffer/commands/bind_push.rs +++ b/vulkano/src/command_buffer/commands/bind_push.rs @@ -607,7 +607,7 @@ impl SyncCommandBufferBuilder { /// Starts the process of binding descriptor sets. Returns an intermediate struct which can be /// used to add the sets. #[inline] - pub fn bind_descriptor_sets(&mut self) -> SyncCommandBufferBuilderBindDescriptorSets { + pub fn bind_descriptor_sets(&mut self) -> SyncCommandBufferBuilderBindDescriptorSets<'_> { SyncCommandBufferBuilderBindDescriptorSets { builder: self, descriptor_sets: SmallVec::new(), @@ -693,7 +693,7 @@ impl SyncCommandBufferBuilder { /// Starts the process of binding vertex buffers. Returns an intermediate struct which can be /// used to add the buffers. #[inline] - pub fn bind_vertex_buffers(&mut self) -> SyncCommandBufferBuilderBindVertexBuffer { + pub fn bind_vertex_buffers(&mut self) -> SyncCommandBufferBuilderBindVertexBuffer<'_> { SyncCommandBufferBuilderBindVertexBuffer { builder: self, inner: UnsafeCommandBufferBuilderBindVertexBuffer::new(), @@ -1270,7 +1270,7 @@ impl error::Error for BindPushError { impl Display for BindPushError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::RequirementNotMet { required_for, diff --git a/vulkano/src/command_buffer/commands/debug.rs b/vulkano/src/command_buffer/commands/debug.rs index 05a7f7ea9..39b41a4b8 100644 --- a/vulkano/src/command_buffer/commands/debug.rs +++ b/vulkano/src/command_buffer/commands/debug.rs @@ -324,7 +324,7 @@ impl Error for DebugUtilsError {} impl Display for DebugUtilsError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::RequirementNotMet { required_for, diff --git a/vulkano/src/command_buffer/commands/dynamic_state.rs b/vulkano/src/command_buffer/commands/dynamic_state.rs index 075c2a8a9..bcb7a9ba1 100644 --- a/vulkano/src/command_buffer/commands/dynamic_state.rs +++ b/vulkano/src/command_buffer/commands/dynamic_state.rs @@ -2881,7 +2881,7 @@ impl Error for SetDynamicStateError {} impl Display for SetDynamicStateError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::RequirementNotMet { required_for, diff --git a/vulkano/src/command_buffer/commands/mod.rs b/vulkano/src/command_buffer/commands/mod.rs index d2df4bd43..6ce2d9d0c 100644 --- a/vulkano/src/command_buffer/commands/mod.rs +++ b/vulkano/src/command_buffer/commands/mod.rs @@ -286,7 +286,7 @@ impl Error for CopyError { impl Display for CopyError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::SyncCommandBufferBuilderError(_) => write!(f, "a SyncCommandBufferBuilderError"), @@ -611,7 +611,7 @@ pub enum CopyErrorResource { impl Display for CopyErrorResource { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::Source => write!(f, "source"), Self::Destination => write!(f, "destination"), diff --git a/vulkano/src/command_buffer/commands/pipeline.rs b/vulkano/src/command_buffer/commands/pipeline.rs index b3a8734bf..45f9a70f4 100644 --- a/vulkano/src/command_buffer/commands/pipeline.rs +++ b/vulkano/src/command_buffer/commands/pipeline.rs @@ -2471,7 +2471,7 @@ impl Error for PipelineExecutionError { impl Display for PipelineExecutionError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::SyncCommandBufferBuilderError(_) => write!(f, "a SyncCommandBufferBuilderError"), @@ -2735,7 +2735,7 @@ impl Error for DescriptorResourceInvalidError { impl Display for DescriptorResourceInvalidError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::ImageViewFormatMismatch { provided, required } => write!( f, diff --git a/vulkano/src/command_buffer/commands/query.rs b/vulkano/src/command_buffer/commands/query.rs index 4f2477229..5e6c4a11e 100644 --- a/vulkano/src/command_buffer/commands/query.rs +++ b/vulkano/src/command_buffer/commands/query.rs @@ -669,7 +669,7 @@ impl SyncCommandBufferBuilder { impl UnsafeCommandBufferBuilder { /// Calls `vkCmdBeginQuery` on the builder. #[inline] - pub unsafe fn begin_query(&mut self, query: Query, flags: QueryControlFlags) { + pub unsafe fn begin_query(&mut self, query: Query<'_>, flags: QueryControlFlags) { let fns = self.device.fns(); let flags = if flags.precise { ash::vk::QueryControlFlags::PRECISE @@ -686,14 +686,14 @@ impl UnsafeCommandBufferBuilder { /// Calls `vkCmdEndQuery` on the builder. #[inline] - pub unsafe fn end_query(&mut self, query: Query) { + pub unsafe fn end_query(&mut self, query: Query<'_>) { let fns = self.device.fns(); (fns.v1_0.cmd_end_query)(self.handle, query.pool().internal_object(), query.index()); } /// Calls `vkCmdWriteTimestamp` on the builder. #[inline] - pub unsafe fn write_timestamp(&mut self, query: Query, stage: PipelineStage) { + pub unsafe fn write_timestamp(&mut self, query: Query<'_>, stage: PipelineStage) { let fns = self.device.fns(); (fns.v1_0.cmd_write_timestamp)( self.handle, @@ -707,7 +707,7 @@ impl UnsafeCommandBufferBuilder { #[inline] pub unsafe fn copy_query_pool_results( &mut self, - queries: QueriesRange, + queries: QueriesRange<'_>, destination: &D, stride: DeviceSize, flags: QueryResultFlags, @@ -737,7 +737,7 @@ impl UnsafeCommandBufferBuilder { /// Calls `vkCmdResetQueryPool` on the builder. #[inline] - pub unsafe fn reset_query_pool(&mut self, queries: QueriesRange) { + pub unsafe fn reset_query_pool(&mut self, queries: QueriesRange<'_>) { let range = queries.range(); let fns = self.device.fns(); (fns.v1_0.cmd_reset_query_pool)( @@ -806,7 +806,7 @@ impl Error for QueryError {} impl Display for QueryError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::SyncCommandBufferBuilderError(_) => write!( f, diff --git a/vulkano/src/command_buffer/commands/render_pass.rs b/vulkano/src/command_buffer/commands/render_pass.rs index 29000a4ac..156a3852e 100644 --- a/vulkano/src/command_buffer/commands/render_pass.rs +++ b/vulkano/src/command_buffer/commands/render_pass.rs @@ -2827,7 +2827,7 @@ impl Error for RenderPassError { impl Display for RenderPassError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::SyncCommandBufferBuilderError(_) => write!(f, "a SyncCommandBufferBuilderError"), diff --git a/vulkano/src/command_buffer/commands/secondary.rs b/vulkano/src/command_buffer/commands/secondary.rs index 70d289a75..66008cd31 100644 --- a/vulkano/src/command_buffer/commands/secondary.rs +++ b/vulkano/src/command_buffer/commands/secondary.rs @@ -395,7 +395,7 @@ impl SyncCommandBufferBuilder { /// Starts the process of executing secondary command buffers. Returns an intermediate struct /// which can be used to add the command buffers. #[inline] - pub unsafe fn execute_commands(&mut self) -> SyncCommandBufferBuilderExecuteCommands { + pub unsafe fn execute_commands(&mut self) -> SyncCommandBufferBuilderExecuteCommands<'_> { SyncCommandBufferBuilderExecuteCommands { builder: self, inner: Vec::new(), @@ -711,7 +711,7 @@ impl Error for ExecuteCommandsError { impl Display for ExecuteCommandsError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::SyncCommandBufferBuilderError(_) => write!(f, "a SyncCommandBufferBuilderError"), diff --git a/vulkano/src/command_buffer/pool/sys.rs b/vulkano/src/command_buffer/pool/sys.rs index d28743c1f..f0f1f6dfe 100644 --- a/vulkano/src/command_buffer/pool/sys.rs +++ b/vulkano/src/command_buffer/pool/sys.rs @@ -384,7 +384,7 @@ impl Error for UnsafeCommandPoolCreationError { impl Display for UnsafeCommandPoolCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::OomError(_) => write!(f, "not enough memory",), Self::QueueFamilyIndexOutOfRange { @@ -533,7 +533,7 @@ impl Error for CommandPoolTrimError {} impl Display for CommandPoolTrimError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::RequirementNotMet { required_for, diff --git a/vulkano/src/command_buffer/synced/builder.rs b/vulkano/src/command_buffer/synced/builder.rs index 35fa7e9f4..2d3f5f24c 100644 --- a/vulkano/src/command_buffer/synced/builder.rs +++ b/vulkano/src/command_buffer/synced/builder.rs @@ -174,7 +174,7 @@ impl SyncCommandBufferBuilder { /// Returns the binding/setting state. #[inline] - pub fn state(&self) -> CommandBufferState { + pub fn state(&self) -> CommandBufferState<'_> { CommandBufferState { current_state: &self.current_state, } @@ -862,7 +862,7 @@ unsafe impl DeviceOwned for SyncCommandBufferBuilder { impl Debug for SyncCommandBufferBuilder { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { Debug::fmt(&self.inner, f) } } @@ -885,7 +885,7 @@ impl Error for SyncCommandBufferBuilderError {} impl Display for SyncCommandBufferBuilderError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { SyncCommandBufferBuilderError::Conflict { .. } => write!(f, "unsolvable conflict"), SyncCommandBufferBuilderError::ExecError(err) => Display::fmt(err, f), diff --git a/vulkano/src/command_buffer/synced/mod.rs b/vulkano/src/command_buffer/synced/mod.rs index a9f3d7abd..51c1cc27b 100644 --- a/vulkano/src/command_buffer/synced/mod.rs +++ b/vulkano/src/command_buffer/synced/mod.rs @@ -520,7 +520,7 @@ pub(super) trait Command: Send + Sync { } impl Debug for dyn Command { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { f.write_str(self.name()) } } diff --git a/vulkano/src/command_buffer/traits.rs b/vulkano/src/command_buffer/traits.rs index 90e234353..63bcc6cbd 100644 --- a/vulkano/src/command_buffer/traits.rs +++ b/vulkano/src/command_buffer/traits.rs @@ -154,7 +154,7 @@ pub unsafe trait PrimaryCommandBuffer: DeviceOwned + Send + Sync { } impl Debug for dyn PrimaryCommandBuffer { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { Debug::fmt(self.inner(), f) } } @@ -559,7 +559,7 @@ impl Error for CommandBufferExecError { impl Display for CommandBufferExecError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", diff --git a/vulkano/src/descriptor_set/layout.rs b/vulkano/src/descriptor_set/layout.rs index 63ff496bd..7bc302c39 100644 --- a/vulkano/src/descriptor_set/layout.rs +++ b/vulkano/src/descriptor_set/layout.rs @@ -520,7 +520,7 @@ impl Error for DescriptorSetLayoutCreationError {} impl Display for DescriptorSetLayoutCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::OomError(_) => { write!(f, "out of memory") @@ -802,7 +802,7 @@ impl Error for DescriptorRequirementsNotMet {} impl Display for DescriptorRequirementsNotMet { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::DescriptorType { required, obtained } => write!( f, diff --git a/vulkano/src/descriptor_set/mod.rs b/vulkano/src/descriptor_set/mod.rs index 60673f748..813be192b 100644 --- a/vulkano/src/descriptor_set/mod.rs +++ b/vulkano/src/descriptor_set/mod.rs @@ -507,7 +507,7 @@ impl Error for DescriptorSetCreationError { impl Display for DescriptorSetCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::DescriptorSetUpdateError(_) => { write!(f, "an error occurred while updating the descriptor set") diff --git a/vulkano/src/descriptor_set/pool/sys.rs b/vulkano/src/descriptor_set/pool/sys.rs index 41fe91e9b..233240051 100644 --- a/vulkano/src/descriptor_set/pool/sys.rs +++ b/vulkano/src/descriptor_set/pool/sys.rs @@ -430,7 +430,7 @@ impl Error for DescriptorPoolAllocError {} impl Display for DescriptorPoolAllocError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", diff --git a/vulkano/src/descriptor_set/sys.rs b/vulkano/src/descriptor_set/sys.rs index 8b09d9dbf..ea212e05e 100644 --- a/vulkano/src/descriptor_set/sys.rs +++ b/vulkano/src/descriptor_set/sys.rs @@ -118,7 +118,7 @@ unsafe impl VulkanObject for UnsafeDescriptorSet { } impl Debug for UnsafeDescriptorSet { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "", self.handle) } } diff --git a/vulkano/src/descriptor_set/update.rs b/vulkano/src/descriptor_set/update.rs index a489a31bd..8842eed85 100644 --- a/vulkano/src/descriptor_set/update.rs +++ b/vulkano/src/descriptor_set/update.rs @@ -950,7 +950,7 @@ impl Error for DescriptorSetUpdateError { impl Display for DescriptorSetUpdateError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::ArrayIndexOutOfBounds { binding, diff --git a/vulkano/src/device/features.rs b/vulkano/src/device/features.rs index e34902698..2d1bbdb5e 100644 --- a/vulkano/src/device/features.rs +++ b/vulkano/src/device/features.rs @@ -28,7 +28,7 @@ impl Error for FeatureRestrictionError {} impl Display for FeatureRestrictionError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "a restriction for the feature {} was not met: {}", @@ -51,7 +51,7 @@ pub enum FeatureRestriction { impl Display for FeatureRestriction { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { FeatureRestriction::NotSupported => { write!(f, "not supported by the physical device") diff --git a/vulkano/src/device/mod.rs b/vulkano/src/device/mod.rs index 77c4c2dba..285e8dd15 100644 --- a/vulkano/src/device/mod.rs +++ b/vulkano/src/device/mod.rs @@ -781,7 +781,7 @@ impl Error for DeviceCreationError {} impl Display for DeviceCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::InitializationFailed => { write!( @@ -971,7 +971,7 @@ impl Error for MemoryFdPropertiesError {} impl Display for MemoryFdPropertiesError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::OutOfHostMemory => write!(f, "no memory available on the host"), diff --git a/vulkano/src/device/physical.rs b/vulkano/src/device/physical.rs index 2424c22f6..32696b3e1 100644 --- a/vulkano/src/device/physical.rs +++ b/vulkano/src/device/physical.rs @@ -2443,13 +2443,13 @@ impl From for ConformanceVersion { } impl Debug for ConformanceVersion { - fn fmt(&self, formatter: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), FmtError> { write!(formatter, "{}.{}.{}", self.major, self.minor, self.patch) } } impl Display for ConformanceVersion { - fn fmt(&self, formatter: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), FmtError> { Debug::fmt(self, formatter) } } @@ -2663,7 +2663,7 @@ impl Error for PhysicalDeviceError { impl Display for PhysicalDeviceError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::VulkanError(_) => write!( f, diff --git a/vulkano/src/device/queue.rs b/vulkano/src/device/queue.rs index 5d68f124f..cdcb61922 100644 --- a/vulkano/src/device/queue.rs +++ b/vulkano/src/device/queue.rs @@ -83,7 +83,7 @@ impl Queue { /// Locks the queue, making it possible to perform operations on the queue, such as submissions. #[inline] - pub fn lock(&self) -> QueueGuard { + pub fn lock(&self) -> QueueGuard<'_> { QueueGuard { queue: self, state: self.state.lock(), @@ -1097,7 +1097,7 @@ impl Error for QueueError { impl Display for QueueError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::VulkanError(_) => write!(f, "a runtime error occurred",), diff --git a/vulkano/src/extensions.rs b/vulkano/src/extensions.rs index cac04a31f..b78ca4dae 100644 --- a/vulkano/src/extensions.rs +++ b/vulkano/src/extensions.rs @@ -26,7 +26,7 @@ impl Error for ExtensionRestrictionError {} impl Display for ExtensionRestrictionError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "a restriction for the extension {} was not met: {}", @@ -49,7 +49,7 @@ pub enum ExtensionRestriction { impl Display for ExtensionRestriction { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { ExtensionRestriction::NotSupported => { write!(f, "not supported by the loader or physical device") diff --git a/vulkano/src/image/attachment.rs b/vulkano/src/image/attachment.rs index c6441c0a9..ee199ebbf 100644 --- a/vulkano/src/image/attachment.rs +++ b/vulkano/src/image/attachment.rs @@ -567,7 +567,7 @@ where A: MemoryPoolAlloc, { #[inline] - fn inner(&self) -> ImageInner { + fn inner(&self) -> ImageInner<'_> { ImageInner { image: &self.image, first_layer: 0, diff --git a/vulkano/src/image/immutable.rs b/vulkano/src/image/immutable.rs index 3f8d576d2..27b2225e5 100644 --- a/vulkano/src/image/immutable.rs +++ b/vulkano/src/image/immutable.rs @@ -319,7 +319,7 @@ where A: MemoryPoolAlloc, { #[inline] - fn inner(&self) -> ImageInner { + fn inner(&self) -> ImageInner<'_> { ImageInner { image: &self.image, first_layer: 0, @@ -403,7 +403,7 @@ where A: MemoryPoolAlloc, { #[inline] - fn inner(&self) -> ImageInner { + fn inner(&self) -> ImageInner<'_> { self.image.inner() } @@ -465,7 +465,7 @@ impl Error for ImmutableImageCreationError { impl Display for ImmutableImageCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::ImageCreationError(err) => err.fmt(f), Self::DeviceMemoryAllocationError(err) => err.fmt(f), diff --git a/vulkano/src/image/storage.rs b/vulkano/src/image/storage.rs index 0d3f216c2..7a0bd5c4f 100644 --- a/vulkano/src/image/storage.rs +++ b/vulkano/src/image/storage.rs @@ -266,7 +266,7 @@ where A: MemoryPool, { #[inline] - fn inner(&self) -> ImageInner { + fn inner(&self) -> ImageInner<'_> { ImageInner { image: &self.image, first_layer: 0, diff --git a/vulkano/src/image/swapchain.rs b/vulkano/src/image/swapchain.rs index ba836d00c..fb27bbbf3 100644 --- a/vulkano/src/image/swapchain.rs +++ b/vulkano/src/image/swapchain.rs @@ -61,7 +61,7 @@ where } #[inline] - fn my_image(&self) -> ImageInner { + fn my_image(&self) -> ImageInner<'_> { self.swapchain.raw_image(self.image_index).unwrap() } @@ -87,7 +87,7 @@ where W: Send + Sync, { #[inline] - fn inner(&self) -> ImageInner { + fn inner(&self) -> ImageInner<'_> { self.my_image() } diff --git a/vulkano/src/image/sys.rs b/vulkano/src/image/sys.rs index dc890bd23..05d03fd3a 100644 --- a/vulkano/src/image/sys.rs +++ b/vulkano/src/image/sys.rs @@ -1451,7 +1451,7 @@ impl UnsafeImage { } #[inline] - pub(crate) fn state(&self) -> MutexGuard { + pub(crate) fn state(&self) -> MutexGuard<'_, ImageState> { self.state.lock() } @@ -2008,7 +2008,7 @@ impl Error for ImageCreationError { impl Display for ImageCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::AllocError(_) => write!(f, "allocating memory failed"), diff --git a/vulkano/src/image/traits.rs b/vulkano/src/image/traits.rs index ae0e7d2be..9a5ab96bc 100644 --- a/vulkano/src/image/traits.rs +++ b/vulkano/src/image/traits.rs @@ -25,7 +25,7 @@ use std::{ /// Trait for types that represent the way a GPU can access an image. pub unsafe trait ImageAccess: DeviceOwned + Send + Sync { /// Returns the inner unsafe image object used by this image. - fn inner(&self) -> ImageInner; + fn inner(&self) -> ImageInner<'_>; /// Returns the dimensions of the image. #[inline] @@ -230,7 +230,7 @@ pub struct ImageInner<'a> { } impl Debug for dyn ImageAccess { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { f.debug_struct("dyn ImageAccess") .field("inner", &self.inner()) .finish() @@ -275,7 +275,7 @@ where I: ImageAccess, { #[inline] - fn inner(&self) -> ImageInner { + fn inner(&self) -> ImageInner<'_> { self.image.inner() } @@ -332,7 +332,7 @@ where T::Target: ImageAccess, { #[inline] - fn inner(&self) -> ImageInner { + fn inner(&self) -> ImageInner<'_> { (**self).inner() } diff --git a/vulkano/src/image/view.rs b/vulkano/src/image/view.rs index b2cd5be8e..5562a2c34 100644 --- a/vulkano/src/image/view.rs +++ b/vulkano/src/image/view.rs @@ -995,7 +995,7 @@ impl Error for ImageViewCreationError { impl Display for ImageViewCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::OomError(_) => write!( f, diff --git a/vulkano/src/instance/debug.rs b/vulkano/src/instance/debug.rs index f63a82734..0fbabf5e9 100644 --- a/vulkano/src/instance/debug.rs +++ b/vulkano/src/instance/debug.rs @@ -54,7 +54,7 @@ use std::{ sync::Arc, }; -pub(super) type UserCallback = Arc; +pub(super) type UserCallback = Arc) + RefUnwindSafe + Send + Sync>; /// Registration of a callback called by validation layers. /// @@ -190,7 +190,7 @@ impl Drop for DebugUtilsMessenger { } impl Debug for DebugUtilsMessenger { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { let Self { handle, instance, @@ -255,7 +255,7 @@ impl Error for DebugUtilsMessengerCreationError {} impl Display for DebugUtilsMessengerCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::RequirementNotMet { required_for, @@ -336,7 +336,7 @@ impl DebugUtilsMessengerCreateInfo { } impl Debug for DebugUtilsMessengerCreateInfo { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { let Self { message_severity, message_type, @@ -452,9 +452,10 @@ mod tests { ..DebugUtilsMessengerCreateInfo::user_callback(Arc::new(|_| {})) }, ) - }; + } + .unwrap(); thread::spawn(move || { - let _ = callback; + drop(callback); }); } } diff --git a/vulkano/src/instance/mod.rs b/vulkano/src/instance/mod.rs index 50dd34867..dadbfd2f6 100644 --- a/vulkano/src/instance/mod.rs +++ b/vulkano/src/instance/mod.rs @@ -595,7 +595,7 @@ impl Hash for Instance { } impl Debug for Instance { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { let Self { handle, fns, @@ -755,7 +755,7 @@ impl Error for InstanceCreationError { impl Display for InstanceCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::OomError(_) => write!(f, "not enough memory available"), Self::InitializationFailed => write!(f, "initialization failed"), diff --git a/vulkano/src/lib.rs b/vulkano/src/lib.rs index 799709483..6fe7f56c7 100644 --- a/vulkano/src/lib.rs +++ b/vulkano/src/lib.rs @@ -62,7 +62,7 @@ //! //#![warn(missing_docs)] // TODO: activate - +#![warn(rust_2018_idioms, rust_2021_compatibility)] // These lints are a bit too pedantic, so they're disabled here. #![allow( clippy::collapsible_else_if, @@ -151,7 +151,7 @@ impl Error for OomError {} impl Display for OomError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", @@ -180,7 +180,7 @@ include!(concat!(env!("OUT_DIR"), "/errors.rs")); impl Error for VulkanError {} impl Display for VulkanError { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { VulkanError::OutOfHostMemory => write!( f, @@ -325,7 +325,7 @@ impl RequiresOneOf { impl Display for RequiresOneOf { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { let mut members_written = 0; if let Some(version) = self.api_version { diff --git a/vulkano/src/library.rs b/vulkano/src/library.rs index 33488228a..cbd4ab101 100644 --- a/vulkano/src/library.rs +++ b/vulkano/src/library.rs @@ -274,7 +274,7 @@ where impl Debug for dyn Loader { #[inline] - fn fmt(&self, _f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, _f: &mut Formatter<'_>) -> Result<(), FmtError> { Ok(()) } } @@ -378,7 +378,7 @@ impl Error for LoadingError { impl Display for LoadingError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", diff --git a/vulkano/src/memory/device_memory.rs b/vulkano/src/memory/device_memory.rs index 4f2d49626..ad5839d03 100644 --- a/vulkano/src/memory/device_memory.rs +++ b/vulkano/src/memory/device_memory.rs @@ -70,7 +70,7 @@ impl DeviceMemory { /// image does not belong to `device`. pub fn allocate( device: Arc, - mut allocate_info: MemoryAllocateInfo, + mut allocate_info: MemoryAllocateInfo<'_>, ) -> Result { Self::validate(&device, &mut allocate_info, None)?; let handle = unsafe { Self::create(&device, &allocate_info, None)? }; @@ -106,7 +106,7 @@ impl DeviceMemory { /// image does not belong to `device`. pub unsafe fn import( device: Arc, - mut allocate_info: MemoryAllocateInfo, + mut allocate_info: MemoryAllocateInfo<'_>, mut import_info: MemoryImportInfo, ) -> Result { Self::validate(&device, &mut allocate_info, Some(&mut import_info))?; @@ -132,7 +132,7 @@ impl DeviceMemory { fn validate( device: &Device, - allocate_info: &mut MemoryAllocateInfo, + allocate_info: &mut MemoryAllocateInfo<'_>, import_info: Option<&mut MemoryImportInfo>, ) -> Result<(), DeviceMemoryError> { let &mut MemoryAllocateInfo { @@ -355,7 +355,7 @@ impl DeviceMemory { unsafe fn create( device: &Device, - allocate_info: &MemoryAllocateInfo, + allocate_info: &MemoryAllocateInfo<'_>, import_info: Option, ) -> Result { let &MemoryAllocateInfo { @@ -983,7 +983,7 @@ impl Error for DeviceMemoryError { impl Display for DeviceMemoryError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::OomError(_) => write!(f, "not enough memory available"), Self::TooManyObjects => { @@ -1473,7 +1473,7 @@ impl Error for MemoryMapError { impl Display for MemoryMapError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::OomError(_) => write!(f, "not enough memory available"), Self::MemoryMapFailed => write!(f, "memory map failed"), diff --git a/vulkano/src/memory/pool/mod.rs b/vulkano/src/memory/pool/mod.rs index 889f405f9..ac4e0aa6e 100644 --- a/vulkano/src/memory/pool/mod.rs +++ b/vulkano/src/memory/pool/mod.rs @@ -80,7 +80,7 @@ pub(crate) fn alloc_dedicated_with_exportable_fd( requirements: &MemoryRequirements, _layout: AllocLayout, map: MappingRequirement, - dedicated_allocation: DedicatedAllocation, + dedicated_allocation: DedicatedAllocation<'_>, filter: F, ) -> Result, DeviceMemoryError> where @@ -181,7 +181,7 @@ pub unsafe trait MemoryPool: DeviceOwned { requirements: &MemoryRequirements, layout: AllocLayout, map: MappingRequirement, - dedicated_allocation: Option, + dedicated_allocation: Option>, filter: F, ) -> Result, DeviceMemoryError> where diff --git a/vulkano/src/pipeline/compute.rs b/vulkano/src/pipeline/compute.rs index d89afae9c..72ded8336 100644 --- a/vulkano/src/pipeline/compute.rs +++ b/vulkano/src/pipeline/compute.rs @@ -70,7 +70,7 @@ impl ComputePipeline { /// to add dynamic buffers or immutable samplers. pub fn new( device: Arc, - shader: EntryPoint, + shader: EntryPoint<'_>, specialization_constants: &Css, cache: Option>, func: F, @@ -117,7 +117,7 @@ impl ComputePipeline { /// uses. pub fn with_pipeline_layout( device: Arc, - shader: EntryPoint, + shader: EntryPoint<'_>, specialization_constants: &Css, layout: Arc, cache: Option>, @@ -158,7 +158,7 @@ impl ComputePipeline { /// superset of what the shader expects. pub unsafe fn with_unchecked_pipeline_layout( device: Arc, - shader: EntryPoint, + shader: EntryPoint<'_>, specialization_constants: &Css, layout: Arc, cache: Option>, @@ -274,7 +274,7 @@ impl Pipeline for ComputePipeline { impl Debug for ComputePipeline { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "", self.handle) } } @@ -344,7 +344,7 @@ impl Error for ComputePipelineCreationError { impl Display for ComputePipelineCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", diff --git a/vulkano/src/pipeline/graphics/builder.rs b/vulkano/src/pipeline/graphics/builder.rs index 35bae4ab4..bb9391170 100644 --- a/vulkano/src/pipeline/graphics/builder.rs +++ b/vulkano/src/pipeline/graphics/builder.rs @@ -169,7 +169,7 @@ where F: FnOnce(&mut [DescriptorSetLayoutCreateInfo]), { let (set_layout_create_infos, push_constant_ranges) = { - let stages: SmallVec<[&EntryPoint; 5]> = [ + let stages: SmallVec<[&EntryPoint<'_>; 5]> = [ self.vertex_shader.as_ref().map(|s| &s.0), self.tessellation_shaders.as_ref().map(|s| &s.control.0), self.tessellation_shaders.as_ref().map(|s| &s.evaluation.0), diff --git a/vulkano/src/pipeline/graphics/creation_error.rs b/vulkano/src/pipeline/graphics/creation_error.rs index a081a4048..6ee8d2bd5 100644 --- a/vulkano/src/pipeline/graphics/creation_error.rs +++ b/vulkano/src/pipeline/graphics/creation_error.rs @@ -212,7 +212,7 @@ impl Error for GraphicsPipelineCreationError { impl Display for GraphicsPipelineCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::RequirementNotMet { required_for, diff --git a/vulkano/src/pipeline/graphics/mod.rs b/vulkano/src/pipeline/graphics/mod.rs index 8db5f46b7..61af2d515 100644 --- a/vulkano/src/pipeline/graphics/mod.rs +++ b/vulkano/src/pipeline/graphics/mod.rs @@ -266,7 +266,7 @@ unsafe impl DeviceOwned for GraphicsPipeline { impl Debug for GraphicsPipeline { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "", self.handle) } } diff --git a/vulkano/src/pipeline/graphics/vertex_input/buffers.rs b/vulkano/src/pipeline/graphics/vertex_input/buffers.rs index 803e29221..fb726b369 100644 --- a/vulkano/src/pipeline/graphics/vertex_input/buffers.rs +++ b/vulkano/src/pipeline/graphics/vertex_input/buffers.rs @@ -34,7 +34,7 @@ struct VertexBuffer { } impl Debug for VertexBuffer { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { f.debug_struct("VertexBuffer") .field("stride", &self.stride) .field("input_rate", &self.input_rate) diff --git a/vulkano/src/pipeline/graphics/vertex_input/definition.rs b/vulkano/src/pipeline/graphics/vertex_input/definition.rs index 65660dbcf..2250d8f04 100644 --- a/vulkano/src/pipeline/graphics/vertex_input/definition.rs +++ b/vulkano/src/pipeline/graphics/vertex_input/definition.rs @@ -104,7 +104,7 @@ impl Error for IncompatibleVertexDefinitionError {} impl Display for IncompatibleVertexDefinitionError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { IncompatibleVertexDefinitionError::MissingAttribute { .. } => { write!(f, "an attribute is missing",) diff --git a/vulkano/src/pipeline/layout.rs b/vulkano/src/pipeline/layout.rs index 4c9fcec99..5984a8db4 100644 --- a/vulkano/src/pipeline/layout.rs +++ b/vulkano/src/pipeline/layout.rs @@ -833,7 +833,7 @@ impl Error for PipelineLayoutCreationError { impl Display for PipelineLayoutCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::OomError(_) => write!(f, "not enough memory available"), @@ -1007,7 +1007,7 @@ impl Error for PipelineLayoutSupersetError { impl Display for PipelineLayoutSupersetError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { PipelineLayoutSupersetError::DescriptorRequirementsNotMet { set_num, binding_num, .. } => write!( f, diff --git a/vulkano/src/query.rs b/vulkano/src/query.rs index d18d1513a..22c40c4b9 100644 --- a/vulkano/src/query.rs +++ b/vulkano/src/query.rs @@ -142,7 +142,7 @@ impl QueryPool { /// Returns a reference to a single query slot, or `None` if the index is out of range. #[inline] - pub fn query(&self, index: u32) -> Option { + pub fn query(&self, index: u32) -> Option> { if index < self.query_count { Some(Query { pool: self, index }) } else { @@ -156,7 +156,7 @@ impl QueryPool { /// /// Panics if the range is empty. #[inline] - pub fn queries_range(&self, range: Range) -> Option { + pub fn queries_range(&self, range: Range) -> Option> { assert!(!range.is_empty()); if range.end <= self.query_count { @@ -259,7 +259,7 @@ impl Error for QueryPoolCreationError { impl Display for QueryPoolCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", @@ -472,7 +472,7 @@ impl Error for GetResultsError { impl Display for GetResultsError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::OomError(_) => write!(f, "not enough memory available"), Self::DeviceLost => write!(f, "the connection to the device has been lost"), diff --git a/vulkano/src/range_map.rs b/vulkano/src/range_map.rs index 581a2f700..d0c67db03 100644 --- a/vulkano/src/range_map.rs +++ b/vulkano/src/range_map.rs @@ -585,7 +585,7 @@ where K: Ord + Clone, V: Eq + Clone, { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { f.debug_map().entries(self.iter()).finish() } } diff --git a/vulkano/src/render_pass/create.rs b/vulkano/src/render_pass/create.rs index 33062667b..bba3b61f6 100644 --- a/vulkano/src/render_pass/create.rs +++ b/vulkano/src/render_pass/create.rs @@ -1588,7 +1588,7 @@ impl Error for RenderPassCreationError { impl Display for RenderPassCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::OomError(_) => write!(f, "not enough memory available",), diff --git a/vulkano/src/render_pass/framebuffer.rs b/vulkano/src/render_pass/framebuffer.rs index 236421d79..c0bf518e8 100644 --- a/vulkano/src/render_pass/framebuffer.rs +++ b/vulkano/src/render_pass/framebuffer.rs @@ -606,7 +606,7 @@ impl Error for FramebufferCreationError { impl Display for FramebufferCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::OomError(_) => write!( f, diff --git a/vulkano/src/sampler/mod.rs b/vulkano/src/sampler/mod.rs index 4bb68dcce..a5aff9900 100644 --- a/vulkano/src/sampler/mod.rs +++ b/vulkano/src/sampler/mod.rs @@ -868,7 +868,7 @@ impl Error for SamplerCreationError { impl Display for SamplerCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::OomError(_) => write!(f, "not enough memory available"), Self::TooManyObjects => write!(f, "too many simultaneous sampler objects",), @@ -1476,7 +1476,7 @@ pub enum SamplerImageViewIncompatibleError { impl Error for SamplerImageViewIncompatibleError {} impl Display for SamplerImageViewIncompatibleError { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::BorderColorFormatNotCompatible => write!(f, "the sampler has a border color with a numeric type different from the image view"), Self::BorderColorOpaqueBlackNotIdentitySwizzled => write!(f, "the sampler has an opaque black border color, but the image view is not identity swizzled"), diff --git a/vulkano/src/sampler/ycbcr.rs b/vulkano/src/sampler/ycbcr.rs index 451542690..5d7bc568f 100644 --- a/vulkano/src/sampler/ycbcr.rs +++ b/vulkano/src/sampler/ycbcr.rs @@ -568,7 +568,7 @@ impl Error for SamplerYcbcrConversionCreationError { impl Display for SamplerYcbcrConversionCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::OomError(_) => write!(f, "not enough memory available"), diff --git a/vulkano/src/shader/mod.rs b/vulkano/src/shader/mod.rs index b5407d4c1..4da6a68e2 100644 --- a/vulkano/src/shader/mod.rs +++ b/vulkano/src/shader/mod.rs @@ -307,7 +307,7 @@ impl Error for ShaderCreationError { } impl Display for ShaderCreationError { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::OomError(_) => write!(f, "not enough memory available"), Self::SpirvCapabilityNotSupported { capability, .. } => write!( @@ -352,7 +352,7 @@ pub enum ShaderSupportError { impl Error for ShaderSupportError {} impl Display for ShaderSupportError { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::NotSupportedByVulkan => write!(f, "not supported by Vulkan"), Self::RequirementsNotMet(requirements) => write!( @@ -688,7 +688,7 @@ pub enum DescriptorRequirementsIncompatible { impl Error for DescriptorRequirementsIncompatible {} impl Display for DescriptorRequirementsIncompatible { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { DescriptorRequirementsIncompatible::DescriptorType => write!( f, @@ -1024,7 +1024,7 @@ impl Error for ShaderInterfaceMismatchError {} impl Display for ShaderInterfaceMismatchError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", diff --git a/vulkano/src/shader/spirv.rs b/vulkano/src/shader/spirv.rs index 2624bb42f..2aef09d25 100644 --- a/vulkano/src/shader/spirv.rs +++ b/vulkano/src/shader/spirv.rs @@ -396,7 +396,7 @@ impl Spirv { /// - Panics if `id` is not defined in this module. This can in theory only happpen if you are /// mixing `Id`s from different modules. #[inline] - pub fn id(&self, id: Id) -> IdInfo { + pub fn id(&self, id: Id) -> IdInfo<'_> { IdInfo { data_indices: &self.ids[&id], instructions: &self.instructions, @@ -571,7 +571,7 @@ impl From for u32 { } impl Display for Id { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "%{}", self.0) } } diff --git a/vulkano/src/swapchain/surface.rs b/vulkano/src/swapchain/surface.rs index e99f0f21a..5228ce4b9 100644 --- a/vulkano/src/swapchain/surface.rs +++ b/vulkano/src/swapchain/surface.rs @@ -1359,7 +1359,7 @@ unsafe impl VulkanObject for Surface { impl Debug for Surface { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { let Self { handle, instance, @@ -1427,7 +1427,7 @@ impl Error for SurfaceCreationError { impl Display for SurfaceCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { SurfaceCreationError::OomError(_) => write!(f, "not enough memory available"), diff --git a/vulkano/src/swapchain/swapchain.rs b/vulkano/src/swapchain/swapchain.rs index b3691665c..69bb523d6 100644 --- a/vulkano/src/swapchain/swapchain.rs +++ b/vulkano/src/swapchain/swapchain.rs @@ -908,7 +908,7 @@ impl Hash for Swapchain { impl Debug for Swapchain { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { let Self { handle, device, @@ -962,7 +962,7 @@ pub unsafe trait SwapchainAbstract: VulkanObject + DeviceOwned + Debug + Send + Sync { /// Returns one of the images that belongs to this swapchain. - fn raw_image(&self, index: u32) -> Option; + fn raw_image(&self, index: u32) -> Option>; /// Returns the number of images of the swapchain. fn image_count(&self) -> u32; @@ -991,7 +991,7 @@ where W: Send + Sync, { #[inline] - fn raw_image(&self, image_index: u32) -> Option { + fn raw_image(&self, image_index: u32) -> Option> { self.images.get(image_index as usize).map(|i| ImageInner { image: &i.image, first_layer: 0, @@ -1277,7 +1277,7 @@ impl Error for SwapchainCreationError { impl Display for SwapchainCreationError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::OomError(_) => write!(f, "not enough memory available",), Self::DeviceLost => write!(f, "the device was lost",), @@ -1469,7 +1469,7 @@ impl Error for FullScreenExclusiveError { impl Display for FullScreenExclusiveError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", @@ -1838,7 +1838,7 @@ impl Error for AcquireError { impl Display for AcquireError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", @@ -1937,7 +1937,7 @@ impl Error for PresentWaitError { impl Display for PresentWaitError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match *self { Self::OomError(e) => write!(f, "{}", e), Self::DeviceLost => write!(f, "the connection to the device has been lost"), diff --git a/vulkano/src/sync/fence.rs b/vulkano/src/sync/fence.rs index 34e866b6b..c0d77c84d 100644 --- a/vulkano/src/sync/fence.rs +++ b/vulkano/src/sync/fence.rs @@ -598,7 +598,7 @@ impl Error for FenceError { } impl Display for FenceError { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::OomError(_) => write!(f, "not enough memory available"), Self::DeviceLost => write!(f, "the device was lost"), diff --git a/vulkano/src/sync/future/fence_signal.rs b/vulkano/src/sync/future/fence_signal.rs index 1f74b908b..9d8aa892a 100644 --- a/vulkano/src/sync/future/fence_signal.rs +++ b/vulkano/src/sync/future/fence_signal.rs @@ -206,7 +206,7 @@ where // Implementation of `flush`. You must lock the state and pass the mutex guard here. fn flush_impl( &self, - state: &mut MutexGuard>, + state: &mut MutexGuard<'_, FenceSignalFutureState>, ) -> Result<(), FlushError> { unsafe { // In this function we temporarily replace the current state with `Poisoned` at the diff --git a/vulkano/src/sync/future/mod.rs b/vulkano/src/sync/future/mod.rs index be60e17da..157d65ace 100644 --- a/vulkano/src/sync/future/mod.rs +++ b/vulkano/src/sync/future/mod.rs @@ -413,7 +413,7 @@ impl Error for AccessError {} impl Display for AccessError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", @@ -454,7 +454,7 @@ impl Error for AccessCheckError {} impl Display for AccessCheckError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", @@ -517,7 +517,7 @@ impl Error for FlushError { impl Display for FlushError { #[inline] - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, "{}", diff --git a/vulkano/src/sync/semaphore.rs b/vulkano/src/sync/semaphore.rs index 861b924fd..1b0536a34 100644 --- a/vulkano/src/sync/semaphore.rs +++ b/vulkano/src/sync/semaphore.rs @@ -516,7 +516,7 @@ impl Error for SemaphoreError { } impl Display for SemaphoreError { - fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match self { Self::OomError(_) => write!(f, "not enough memory available"), diff --git a/vulkano/src/version.rs b/vulkano/src/version.rs index da71340a5..11e42fbf1 100644 --- a/vulkano/src/version.rs +++ b/vulkano/src/version.rs @@ -99,13 +99,13 @@ impl FromStr for Version { } impl Debug for Version { - fn fmt(&self, formatter: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), FmtError> { write!(formatter, "{}.{}.{}", self.major, self.minor, self.patch) } } impl Display for Version { - fn fmt(&self, formatter: &mut Formatter) -> Result<(), FmtError> { + fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), FmtError> { Debug::fmt(self, formatter) } }