Skip to content

Improve diagnostics for parse errors in proc macro output #41663

Open
@abonander

Description

Currently we make no real effort to inform users of parse errors in procedural macro output:

let msg = "proc-macro derive produced unparseable tokens";

People are stumbling on this in the wild: https://www.reddit.com/r/rust/comments/689ogb/how_to_debug_procmacro_derive_produced/

CC @nrc @jseyfried

I have some ideas on how to move forward but should we wait until #40939 lands? I don't think it's necessary since the changes would be (mostly) orthogonal.

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The parsing of Rust source code to an ASTA-proc-macrosArea: Procedural macrosT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions