spirv attribute errors in proc macros don't show errors properly due to span being the macro invocation
Open
Nobody has claimed this yet.
bug
- Dominant language
- Rust
- Stars
- 3.4k
- Forks
- 125
- PR merge metrics
- No merged PRs in 30d
Description
If you codegen spirv entry points and you typo an attribute, you get this error not showing you which one you typo'ed, since the span is from the macro invocation.
error: unknown argument to spirv attribute
--> node-graph/graster-nodes/src/adjustments.rs:44:1
|
44 | #[node_macro::node(category("Raster: Adjustment"), shader_node(PerPixelAdjust))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the attribute macro `node_macro::node` (in Nightly builds, run with -Z macro-backtrace for more info)
System Info
- Rust-GPU master
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the typo in the spirv attribute on node-graph/graster-nodes/src/adjustments.rs:44 and inspect the node_macro::node attribute macro's error reporting. Trace how the attribute span is selected, then verify that an unknown argument identifies the offending attribute rather than only the macro invocation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100