Skip to content

Commit 1f67474

Browse files
Add directive keywords to error message for parsing global item (#6723)
Notify the user that they can also use `diagnostic`, `enable`, or `requires` in this context. Co-authored-by: Erich Gubler <[email protected]>
1 parent eeb79f3 commit 1f67474

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ By @wumpf in [#6849](https://github.com/gfx-rs/wgpu/pull/6849).
171171
- The GLSL parser now uses less expressions for function calls. By @magcius in [#6604](https://github.com/gfx-rs/wgpu/pull/6604).
172172
- Add a note to help with a common syntax error case for global diagnostic filter directives. By @e-hat in [#6718](https://github.com/gfx-rs/wgpu/pull/6718)
173173
- Change arithmetic operations between two i32 variables to wrap on overflow to match WGSL spec. By @matthew-wong1 in [#6835](https://github.com/gfx-rs/wgpu/pull/6835).
174+
- Add directives to suggestions in error message for parsing global items. By @e-hat in [#6723](https://github.com/gfx-rs/wgpu/pull/6723).
174175

175176
##### General
176177

naga/src/front/wgsl/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ impl<'a> Error<'a> {
390390
"workgroup size separator (',') or a closing parenthesis".to_string()
391391
}
392392
ExpectedToken::GlobalItem => concat!(
393-
"global item ('struct', 'const', 'var', 'alias', ';', 'fn') ",
393+
"global item ('struct', 'const', 'var', 'alias', 'fn', 'diagnostic', 'enable', 'requires', ';') ",
394394
"or the end of the file"
395395
)
396396
.to_string(),

0 commit comments

Comments
 (0)