Skip to content

Diagnostic for requiring [raypayload] attribute could be clearer #7358

Open
@tex3d

Description

@tex3d

Description
When using a payload without the [raypayload] attribute on the struct, you get a diagnostic error pointing at the variable declaration, such as:

<file:line>: error: type 'Payload' used as payload requires that it is annotated with the [raypayload] attribute
MyPayload pld;
          ^

The problem is with the type used, so just pointing at the variable declaration does not show you where the attribute was expected. It should add a note pointing to the struct declaration, and provide a fixit for the location of the attribute, since the location is not very intuitive: between the struct and the name of the struct.

Steps to Reproduce
https://godbolt.org/z/7sq5q17h6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashneeds-triageAwaiting triage

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions