Skip to content

Commit c8e9412

Browse files
FIXUP: ugh yet more lint expectations
1 parent 21e7e32 commit c8e9412

69 files changed

Lines changed: 103 additions & 140 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

naga-cli/src/bin/naga.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![allow(clippy::manual_strip)]
21
use anyhow::{anyhow, Context as _};
3-
#[allow(unused_imports)]
42
use std::fs;
53
use std::{error::Error, fmt, io::Read, path::Path, str::FromStr};
64

@@ -260,10 +258,10 @@ impl FromStr for GlslProfileArg {
260258

261259
fn from_str(s: &str) -> Result<Self, Self::Err> {
262260
use naga::back::glsl::Version;
263-
Ok(Self(if s.starts_with("core") {
264-
Version::Desktop(s[4..].parse().unwrap_or(330))
265-
} else if s.starts_with("es") {
266-
Version::new_gles(s[2..].parse().unwrap_or(310))
261+
Ok(Self(if let Some(s) = s.strip_prefix("core") {
262+
Version::Desktop(s.parse().unwrap_or(330))
263+
} else if let Some(s) = s.strip_prefix("es") {
264+
Version::new_gles(s.parse().unwrap_or(310))
267265
} else {
268266
return Err(format!("Unknown profile: {s}"));
269267
}))

naga/src/arena/handlevec.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ impl<T, U> Default for HandleVec<T, U> {
3434
}
3535
}
3636

37-
#[allow(dead_code)]
3837
impl<T, U> HandleVec<T, U> {
3938
pub(crate) const fn new() -> Self {
4039
Self {
@@ -66,7 +65,10 @@ impl<T, U> HandleVec<T, U> {
6665
assert_eq!(handle.index(), self.inner.len());
6766
self.inner.push(value);
6867
}
68+
}
6969

70+
#[cfg_attr(not(any(glsl_out, spv_out, msl_out)), expect(dead_code))]
71+
impl<T, U> HandleVec<T, U> {
7072
pub(crate) fn get(&self, handle: Handle<T>) -> Option<&U> {
7173
self.inner.get(handle.index())
7274
}

naga/src/arena/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ impl<T> Arena<T> {
7878
}
7979

8080
/// Extracts the inner vector.
81-
#[allow(clippy::missing_const_for_fn)] // ignore due to requirement of #![feature(const_precise_live_drops)]
8281
pub fn into_inner(self) -> Vec<T> {
8382
self.data
8483
}

naga/src/back/hlsl/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ where
242242
pub type BindingMap = alloc::collections::BTreeMap<crate::ResourceBinding, BindTarget>;
243243

244244
/// A HLSL shader model version.
245-
#[allow(non_snake_case, non_camel_case_types)]
246245
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, PartialOrd)]
247246
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
248247
#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]

naga/src/back/msl/sampler.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ pub struct InlineSampler {
132132

133133
impl Eq for InlineSampler {}
134134

135-
#[allow(renamed_and_removed_lints)]
136-
#[allow(clippy::derive_hash_xor_eq)]
137135
impl core::hash::Hash for InlineSampler {
138136
fn hash<H: core::hash::Hasher>(&self, hasher: &mut H) {
139137
self.coord.hash(hasher);

naga/src/back/msl/writer.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,6 @@ impl<W: Write> Writer<W> {
864864

865865
/// Finishes writing and returns the output.
866866
// See https://github.com/rust-lang/rust-clippy/issues/4979.
867-
#[allow(clippy::missing_const_for_fn)]
868867
pub fn finish(self) -> W {
869868
self.out
870869
}
@@ -1778,7 +1777,7 @@ impl<W: Write> Writer<W> {
17781777
Ok(())
17791778
}
17801779

1781-
#[allow(clippy::too_many_arguments)]
1780+
#[expect(clippy::too_many_arguments)]
17821781
fn put_possibly_const_expression<C, I, E>(
17831782
&mut self,
17841783
expr_handle: Handle<crate::Expression>,
@@ -3035,7 +3034,6 @@ impl<W: Write> Writer<W> {
30353034
/// [`ReadZeroSkipWrite`]: index::BoundsCheckPolicy::ReadZeroSkipWrite
30363035
/// [`Store`]: crate::Statement::Store
30373036
/// [`Load`]: crate::Expression::Load
3038-
#[allow(unused_variables)]
30393037
fn put_bounds_checks(
30403038
&mut self,
30413039
chain: Handle<crate::Expression>,

naga/src/back/spv/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2987,7 +2987,7 @@ impl BlockContext<'_> {
29872987
}
29882988

29892989
/// Build the instructions for matrix - matrix column operations
2990-
#[allow(clippy::too_many_arguments)]
2990+
#[expect(clippy::too_many_arguments)]
29912991
fn write_matrix_matrix_column_op(
29922992
&mut self,
29932993
block: &mut Block,

naga/src/back/spv/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub(super) fn str_bytes_to_words(bytes: &[u8]) -> Vec<Word> {
2929
}
3030

3131
/// split a string into chunks and keep utf8 valid
32-
#[allow(unstable_name_collisions)]
32+
#[expect(unstable_name_collisions)]
3333
pub(super) fn string_to_byte_chunks(input: &str, limit: usize) -> Vec<&[u8]> {
3434
let mut offset: usize = 0;
3535
let mut start: usize = 0;

naga/src/back/spv/image.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ impl BlockContext<'_> {
719719
/// Generate code for an `ImageLoad` expression.
720720
///
721721
/// The arguments are the components of an `Expression::ImageLoad` variant.
722-
#[allow(clippy::too_many_arguments)]
722+
#[expect(clippy::too_many_arguments)]
723723
pub(super) fn write_image_load(
724724
&mut self,
725725
result_type_id: Word,
@@ -799,7 +799,7 @@ impl BlockContext<'_> {
799799
/// Generate code for an `ImageSample` expression.
800800
///
801801
/// The arguments are the components of an `Expression::ImageSample` variant.
802-
#[allow(clippy::too_many_arguments)]
802+
#[expect(clippy::too_many_arguments)]
803803
pub(super) fn write_image_sample(
804804
&mut self,
805805
result_type_id: Word,

naga/src/back/spv/instructions.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ impl super::Instruction {
309309
instruction
310310
}
311311

312-
#[allow(clippy::too_many_arguments)]
313312
pub(super) fn type_image(
314313
id: Word,
315314
sampled_type_id: Word,
@@ -779,7 +778,7 @@ impl super::Instruction {
779778
//
780779
// Ray Query Instructions
781780
//
782-
#[allow(clippy::too_many_arguments)]
781+
#[expect(clippy::too_many_arguments)]
783782
pub(super) fn ray_query_initialize(
784783
query: Word,
785784
acceleration_structure: Word,

0 commit comments

Comments
 (0)