Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve diagnostics for parse errors in proc macro output #41663

Open
abonander opened this issue Apr 30, 2017 · 1 comment
Open

Improve diagnostics for parse errors in proc macro output #41663

abonander opened this issue Apr 30, 2017 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST A-proc-macros Area: Procedural macros T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@abonander
Copy link
Contributor

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.

@Mark-Simulacrum Mark-Simulacrum added A-syntaxext Area: Syntax extensions A-macros-2.0 Area: Declarative macros 2.0 (#39412) and removed A-syntaxext Area: Syntax extensions labels Jun 22, 2017
@Mark-Simulacrum Mark-Simulacrum added A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Jul 27, 2017
@crlf0710 crlf0710 added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 11, 2020
@fmease fmease added A-parser Area: The parsing of Rust source code to an AST A-proc-macros Area: Procedural macros and removed A-macros-2.0 Area: Declarative macros 2.0 (#39412) C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Aug 29, 2024
@taladar
Copy link

taladar commented Oct 1, 2024

This still seems to be the same useless error in 2024, would it be possible to at least print the unparseable tokens in this situation as part of the error message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST A-proc-macros Area: Procedural macros T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants