Skip to content

Custom derives and procedural attribute macros don't show errors #9132

@jonas-schievink

Description

@jonas-schievink

When we expand custom #[derive]s and attribute macros, we seem to ignore their errors.

Interestingly, if you do this:

serde::Deserialize!(struct S {
    #[serde(asd)]
    fld: u8,
});

...then the error shows up only if the invocation is inside a function body, not when it's in item position. (of course, the fact that you can call a custom derive like that is itself a bug)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsdiagnostics / error reportingA-macromacro expansion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions