Skip to content

quote_expr!() can cause early abort #14282

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

Closed
lilyball opened this issue May 18, 2014 · 3 comments
Closed

quote_expr!() can cause early abort #14282

lilyball opened this issue May 18, 2014 · 3 comments
Labels
A-syntaxext Area: Syntax extensions

Comments

@lilyball
Copy link
Contributor

It seems as though using quote_expr!() in a syntax extension after a span_err() will cause rustc to abort early instead of finishing the macro expansion phase.

I hit this in my bytes!() PR, where I ended up having to track whether I had an error and use DummyResult instead of quote_expr!().

@tamird
Copy link
Contributor

tamird commented Apr 26, 2015

@kballard could you include a small reproduction snippet to help make this issue more concrete?

@lilyball
Copy link
Contributor Author

@tamird I filed this issue almost a year ago. I don't recall the circumstances surrounding it, beyond what I put in the ticket. From re-reading this, I'm pretty sure that what I was saying is that if a syntax extension uses quote_expr!() after having previously invoked cx.span_err() it aborts immediately, instead of continuing the macro expansion phase (span_err() usually doesn't abort the compilation until the end of the macro expansion phase; I think quote_expr!() is basically recursively invoking the macro expansion phase and therefore aborting after the recursive invocation ends).

@steveklabnik
Copy link
Member

Triage: this ticket hasn't had an update in almost two years, and there's no reproduction. As such, I'm going to give it a close. If someone runs into this today and can reproduce, please let me know!

lnicola pushed a commit to lnicola/rust that referenced this issue Mar 13, 2023
…eykril

fix: Load proc-macros for rustc_private crates

Fixes rust-lang/rust-analyzer#13591

Verified that this makes things work in the clippy repo (like resolving `sym` things for example)
flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-syntaxext Area: Syntax extensions
Projects
None yet
Development

No branches or pull requests

3 participants