mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 14:01:08 +01:00
fix(wgsl-in): increase brace limit to 127 (#7412)
This commit is contained in:
1 parent
97dbdc7d75
commit
958528fb14
2 files changed
+63
-15
No files matched your search
@@ -3120,12 +3120,7 @@ impl Parser {
|
||||
// > …
|
||||
// >
|
||||
// > Maximum nesting depth of brace-enclosed statements in a function[:] 127
|
||||
//
|
||||
// _However_, we choose 64 instead because (a) it avoids stack overflows in CI and
|
||||
// (b) we expect the limit to be decreased to 63 based on this conversation in
|
||||
// WebGPU CTS upstream:
|
||||
// <https://github.com/gpuweb/cts/pull/3389#discussion_r1543742701>
|
||||
const BRACE_NESTING_MAXIMUM: u8 = 64;
|
||||
const BRACE_NESTING_MAXIMUM: u8 = 127;
|
||||
if brace_nesting_level + 1 > BRACE_NESTING_MAXIMUM {
|
||||
return Err(Box::new(Error::ExceededLimitForNestedBraces {
|
||||
span: brace_span,
|
||||
|
||||
@@ -2699,12 +2699,12 @@ fn limit_braced_statement_nesting() {
|
||||
let too_many_braces = "fn f() {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{";
|
||||
|
||||
let expected_diagnostic = r###"error: brace nesting limit reached
|
||||
┌─ wgsl:1:72
|
||||
┌─ wgsl:1:135
|
||||
│
|
||||
1 │ fn f() {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
|
||||
│ ^ limit reached at this brace
|
||||
│ ^ limit reached at this brace
|
||||
│
|
||||
= note: nesting limit is currently set to 64
|
||||
= note: nesting limit is currently set to 127
|
||||
|
||||
"###;
|
||||
|
||||
@@ -2796,16 +2796,69 @@ fn too_many_unclosed_loops() {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
";
|
||||
|
||||
let expected_diagnostic = r###"error: brace nesting limit reached
|
||||
┌─ wgsl:65:13
|
||||
│
|
||||
65 │ loop {
|
||||
│ ^ limit reached at this brace
|
||||
│
|
||||
= note: nesting limit is currently set to 64
|
||||
┌─ wgsl:128:13
|
||||
│
|
||||
128 │ loop {
|
||||
│ ^ limit reached at this brace
|
||||
│
|
||||
= note: nesting limit is currently set to 127
|
||||
|
||||
"###;
|
||||
|
||||
|
||||
Reference in new issue
Block a user