Skip to content

spirv attribute errors in proc macros don't show errors properly due to span being the macro invocation #355

@Firestar99

Description

@Firestar99

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions