chore(naga): Enable large_stack_frames lint

This commit is contained in:
Andy Leiserson authored and Jim Blandy committed 2026-06-17 07:59:12 -07:00
1 parent d1ef7134a1
commit cdb08a7728
7 files changed
+16 -1

No files matched your search

+7
View File
@@ -8,3 +8,10 @@ disallowed-types = [
# The default large-error-threshold is 128. We have a bunch of complex error
# types that are slightly larger than that.
large-error-threshold = 192
# This relatively small stack frame limit is set to avoid problems in several deeply
# recursive functions in naga. If your function has a genuine need for a larger stack frame,
# and is not at risk of deep recursion based on shader structure, it is okay to waive the
# associated `clippy::large_stack_frames` lint.
# TODO(https://github.com/gfx-rs/wgpu/issues/9456): Consider reducing this further
stack-size-threshold = 40_960
+1
View File
@@ -2405,6 +2405,7 @@ impl<'a, W: Write> Writer<'a, W> {
///
/// # Notes
/// Doesn't add any newlines or leading/trailing spaces
#[allow(clippy::large_stack_frames)] // TODO(https://github.com/gfx-rs/wgpu/issues/9456)
fn write_expr(
&mut self,
expr: Handle<crate::Expression>,
+1
View File
@@ -540,6 +540,7 @@ impl<'a> Context<'a> {
}
/// Internal implementation of [`lower`](Self::lower)
#[allow(clippy::large_stack_frames)] // TODO(https://github.com/gfx-rs/wgpu/issues/9456)
fn lower_inner(
&mut self,
stmt: &StmtContext,
+1
View File
@@ -18,6 +18,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
/// Except for the function's entry block, `block_id` should be the label of
/// a block we've seen mentioned before, with an entry in
/// `block_ctx.body_for_label` to tell us which `Body` it contributes to.
#[allow(clippy::large_stack_frames)] // TODO(https://github.com/gfx-rs/wgpu/issues/9456)
pub(in crate::front::spv) fn next_block(
&mut self,
block_id: spirv::Word,
+3
View File
@@ -525,6 +525,9 @@ pub(crate) struct ConcretizationFailedError {
impl<'a> Error<'a> {
#[cold]
#[inline(never)]
// This function is not recursive, so it can exceed our conservatively-set
// `stack-frame-limit` without causing problems.
#[allow(clippy::large_stack_frames)]
pub(crate) fn as_parse_error(&self, source: &'a str) -> ParseError {
match *self {
Error::Unexpected(unexpected_span, expected) => {
+2 -1
View File
@@ -82,10 +82,11 @@ void main() {
trivial_numeric_casts,
unused_extern_crates,
unused_qualifications,
clippy::large_stack_frames,
clippy::match_wildcard_for_single_variants,
clippy::missing_const_for_fn,
clippy::pattern_type_mismatch,
clippy::rest_pat_in_fully_bound_structs,
clippy::rest_pat_in_fully_bound_structs
)]
#![deny(clippy::exit)]
#![cfg_attr(
+1
View File
@@ -779,6 +779,7 @@ impl super::Validator {
Ok(())
}
#[allow(clippy::large_stack_frames)] // TODO(https://github.com/gfx-rs/wgpu/issues/9456)
fn validate_block_impl(
&mut self,
statements: &crate::Block,