Skip to content

Commit 909096d

Browse files
authored
Enable and fix rust_2024_incompatible_pat lint (#2631)
1 parent bdfc34c commit 909096d

File tree

10 files changed

+24
-23
lines changed

10 files changed

+24
-23
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ ron = "0.8"
8585
rust.missing_docs = "allow" # TODO: warn eventually
8686
rust.rust_2018_idioms = { level = "warn", priority = -1 }
8787
rust.rust_2024_compatibility = { level = "allow", priority = -1 } # TODO: warn eventually
88+
rust.rust_2024_incompatible_pat = "warn"
8889
rust.unsafe_op_in_unsafe_fn = "warn"
8990
clippy.borrow_as_ptr = "warn"
9091
clippy.missing_safety_doc = "allow" # TODO: warn eventually

vulkano-util/src/window.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ impl Default for WindowResizeConstraints {
395395
impl WindowResizeConstraints {
396396
#[must_use]
397397
pub fn check_constraints(&self) -> Self {
398-
let WindowResizeConstraints {
398+
let &WindowResizeConstraints {
399399
mut min_width,
400400
mut min_height,
401401
mut max_width,

vulkano/src/command_buffer/commands/acceleration_structure.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -626,14 +626,14 @@ fn add_build_geometry_resources(
626626
used_resources: &mut Vec<(ResourceUseRef2, Resource)>,
627627
info: &AccelerationStructureBuildGeometryInfo,
628628
) {
629-
let &AccelerationStructureBuildGeometryInfo {
629+
let AccelerationStructureBuildGeometryInfo {
630630
flags: _,
631-
ref mode,
632-
ref dst_acceleration_structure,
633-
ref geometries,
634-
ref scratch_data,
631+
mode,
632+
dst_acceleration_structure,
633+
geometries,
634+
scratch_data,
635635
_ne: _,
636-
} = &info;
636+
} = info;
637637

638638
match geometries {
639639
AccelerationStructureGeometries::Triangles(geometries) => {

vulkano/src/command_buffer/commands/render_pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ impl RecordingCommandBuffer {
16211621
}
16221622

16231623
for (rect_index, rect) in rects.iter().enumerate() {
1624-
let ClearRect {
1624+
let &ClearRect {
16251625
offset: _,
16261626
extent,
16271627
ref array_layers,

vulkano/src/command_buffer/sys.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,11 @@ impl Default for CommandBufferBeginInfo {
211211

212212
impl CommandBufferBeginInfo {
213213
pub(crate) fn validate(&self, device: &Device) -> Result<(), Box<ValidationError>> {
214-
let &Self {
214+
let Self {
215215
usage: _,
216-
ref inheritance_info,
216+
inheritance_info,
217217
_ne: _,
218-
} = &self;
218+
} = self;
219219

220220
if let Some(inheritance_info) = &inheritance_info {
221221
inheritance_info

vulkano/src/image/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,7 +2356,7 @@ impl ImageFormatProperties {
23562356

23572357
if let Some(val_vk) = external_vk {
23582358
let ash::vk::ExternalImageFormatProperties {
2359-
ref external_memory_properties,
2359+
external_memory_properties,
23602360
..
23612361
} = val_vk;
23622362

@@ -2620,7 +2620,7 @@ impl SparseImageMemoryRequirements {
26202620

26212621
pub(crate) fn from_vk2(val_vk: &ash::vk::SparseImageMemoryRequirements2<'_>) -> Self {
26222622
let ash::vk::SparseImageMemoryRequirements2 {
2623-
ref memory_requirements,
2623+
memory_requirements,
26242624
..
26252625
} = val_vk;
26262626

vulkano/src/pipeline/compute.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,12 @@ impl ComputePipelineCreateInfo {
312312
}));
313313
}
314314

315-
let &PipelineShaderStageCreateInfo {
315+
let PipelineShaderStageCreateInfo {
316316
flags: _,
317-
ref entry_point,
318-
required_subgroup_size: _vk,
317+
entry_point,
318+
required_subgroup_size: _,
319319
_ne: _,
320-
} = &stage;
320+
} = stage;
321321

322322
let entry_point_info = entry_point.info();
323323

vulkano/src/pipeline/graphics/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,8 +1618,8 @@ impl GraphicsPipelineCreateInfo {
16181618

16191619
if let Some(viewport_state) = viewport_state {
16201620
let ViewportState {
1621-
ref viewports,
1622-
ref scissors,
1621+
viewports,
1622+
scissors,
16231623
_ne: _,
16241624
} = viewport_state;
16251625

vulkano/src/shader/spirv/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,15 @@ impl Spirv {
310310
let id_info = ids.get_mut(&target).unwrap();
311311

312312
match instruction {
313-
Instruction::Decorate { ref decoration, .. } => {
313+
Instruction::Decorate { decoration, .. } => {
314314
let instruction = Instruction::Decorate {
315315
target,
316316
decoration: decoration.clone(),
317317
};
318318
id_info.decorations.push(instruction.clone());
319319
instruction
320320
}
321-
Instruction::DecorateId { ref decoration, .. } => {
321+
Instruction::DecorateId { decoration, .. } => {
322322
let instruction = Instruction::DecorateId {
323323
target,
324324
decoration: decoration.clone(),
@@ -351,7 +351,7 @@ impl Spirv {
351351
[member as usize];
352352

353353
match instruction {
354-
Instruction::Decorate { ref decoration, .. } => {
354+
Instruction::Decorate { decoration, .. } => {
355355
let instruction = Instruction::MemberDecorate {
356356
structure_type,
357357
member,

vulkano/src/swapchain/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2227,7 +2227,7 @@ impl SwapchainCreateInfo {
22272227

22282228
let (image_sharing_mode_vk, queue_family_indices_vk) = match image_sharing {
22292229
Sharing::Exclusive => (ash::vk::SharingMode::EXCLUSIVE, [].as_slice()),
2230-
Sharing::Concurrent(ref ids) => (ash::vk::SharingMode::CONCURRENT, ids.as_slice()),
2230+
Sharing::Concurrent(ids) => (ash::vk::SharingMode::CONCURRENT, ids.as_slice()),
22312231
};
22322232

22332233
let mut val_vk = ash::vk::SwapchainCreateInfoKHR::default()

0 commit comments

Comments
 (0)