Skip to content

Commit 253d1c6

Browse files
FIXUP: ugh yet more lint expectations
1 parent ba94772 commit 253d1c6

75 files changed

Lines changed: 126 additions & 162 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

@@ -227,10 +225,10 @@ impl FromStr for GlslProfileArg {
227225

228226
fn from_str(s: &str) -> Result<Self, Self::Err> {
229227
use naga::back::glsl::Version;
230-
Ok(Self(if s.starts_with("core") {
231-
Version::Desktop(s[4..].parse().unwrap_or(330))
232-
} else if s.starts_with("es") {
233-
Version::new_gles(s[2..].parse().unwrap_or(310))
228+
Ok(Self(if let Some(s) = s.strip_prefix("core") {
229+
Version::Desktop(s.parse().unwrap_or(330))
230+
} else if let Some(s) = s.strip_prefix("es") {
231+
Version::new_gles(s.parse().unwrap_or(310))
234232
} else {
235233
return Err(format!("Unknown profile: {s}"));
236234
}))

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/glsl/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4240,7 +4240,7 @@ impl<'a, W: Write> Writer<'a, W> {
42404240
}
42414241

42424242
/// Helper method for writing an `ImageLoad` expression.
4243-
#[allow(clippy::too_many_arguments)]
4243+
#[expect(clippy::too_many_arguments)]
42444244
fn write_image_load(
42454245
&mut self,
42464246
handle: Handle<crate::Expression>,

naga/src/back/hlsl/mod.rs

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

180180
/// A HLSL shader model version.
181-
#[allow(non_snake_case, non_camel_case_types)]
182181
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, PartialOrd)]
183182
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
184183
#[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
@@ -157,8 +157,6 @@ pub struct InlineSampler {
157157

158158
impl Eq for InlineSampler {}
159159

160-
#[allow(renamed_and_removed_lints)]
161-
#[allow(clippy::derive_hash_xor_eq)]
162160
impl core::hash::Hash for InlineSampler {
163161
fn hash<H: core::hash::Hasher>(&self, hasher: &mut H) {
164162
self.coord.hash(hasher);

naga/src/back/msl/writer.rs

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

730730
/// Finishes writing and returns the output.
731731
// See https://github.com/rust-lang/rust-clippy/issues/4979.
732-
#[allow(clippy::missing_const_for_fn)]
733732
pub fn finish(self) -> W {
734733
self.out
735734
}
@@ -1449,7 +1448,7 @@ impl<W: Write> Writer<W> {
14491448
)
14501449
}
14511450

1452-
#[allow(clippy::too_many_arguments)]
1451+
#[expect(clippy::too_many_arguments)]
14531452
fn put_possibly_const_expression<C, I, E>(
14541453
&mut self,
14551454
expr_handle: Handle<crate::Expression>,
@@ -2590,7 +2589,6 @@ impl<W: Write> Writer<W> {
25902589
/// [`ReadZeroSkipWrite`]: index::BoundsCheckPolicy::ReadZeroSkipWrite
25912590
/// [`Store`]: crate::Statement::Store
25922591
/// [`Load`]: crate::Expression::Load
2593-
#[allow(unused_variables)]
25942592
fn put_bounds_checks(
25952593
&mut self,
25962594
mut chain: Handle<crate::Expression>,

naga/src/back/spv/block.rs

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

24052405
/// Build the instructions for matrix - matrix column operations
2406-
#[allow(clippy::too_many_arguments)]
2406+
#[expect(clippy::too_many_arguments)]
24072407
fn write_matrix_matrix_column_op(
24082408
&mut self,
24092409
block: &mut Block,

naga/src/back/spv/helpers.rs

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

3030
/// split a string into chunks and keep utf8 valid
31-
#[allow(unstable_name_collisions)]
31+
#[expect(unstable_name_collisions)]
3232
pub(super) fn string_to_byte_chunks(input: &str, limit: usize) -> Vec<&[u8]> {
3333
let mut offset: usize = 0;
3434
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
@@ -718,7 +718,7 @@ impl BlockContext<'_> {
718718
/// Generate code for an `ImageLoad` expression.
719719
///
720720
/// The arguments are the components of an `Expression::ImageLoad` variant.
721-
#[allow(clippy::too_many_arguments)]
721+
#[expect(clippy::too_many_arguments)]
722722
pub(super) fn write_image_load(
723723
&mut self,
724724
result_type_id: Word,
@@ -798,7 +798,7 @@ impl BlockContext<'_> {
798798
/// Generate code for an `ImageSample` expression.
799799
///
800800
/// The arguments are the components of an `Expression::ImageSample` variant.
801-
#[allow(clippy::too_many_arguments)]
801+
#[expect(clippy::too_many_arguments)]
802802
pub(super) fn write_image_sample(
803803
&mut self,
804804
result_type_id: Word,

0 commit comments

Comments
 (0)