Closed
Description
We do not currently support the @must_use
function attribute, despite being specified in the current v1 spec. draft. This was introduced in early 2023; see gpuweb/gpuweb
#3862, gpuweb/gpuweb
#3819.
Repro steps
Ideally, a runnable example we can check out.
-
With this
in.wgsl
input file:@must_use fn helper() -> u32 { return 2; } @compute @workgroup_size(1) fn comp_main() { let asdf = helper(); }
…run this on latest
trunk
(ATOW, d239361):$ cargo run -p naga-cli --all-features -- in.wgsl
Expected vs observed behavior
Clearly describe what you get, and how it goes across your expectations.
This should compile without error. The asdf
binding is unused, but that should, at most, be a warning. Instead, the current output of repro steps is:
Could not parse WGSL:
error: unknown attribute: 'must_use'
┌─ in.wgsl:1:2
│
1 │ @must_use
│ ^^^^^^^^ unknown attribute
Metadata
Assignees
Type
Projects
Status
Done