-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Nightly rustc panics when passing r#Self enum variant through proc macro #81321
Comments
In the macro, passing pub fn this_is_fine(_: TokenStream, input: TokenStream) -> TokenStream {
input
} |
I believe this is one of the "delayed error" bugs, where we detect an error and report it, but continue compilation, which causes another code to panic as the error detected earlier breaks an assumption in another code later on. If I'm right then I suspect fixing this is just a matter of turning the |
…r was already reported Fixes rust-lang#81321
I submitted a PR that does what I describe above. I don't know if it's the right thing to do though. Any feedback would be welcome! |
Closing as a duplicate of #59998. |
Yeah, if panics produced by proc macro server turn into ICEs, then it's #59998, regardless of targets. |
This is not really the same as #59998. That issue occurs when a proc-macro explicitly tries to create an invalid |
This has some conceptual similarities to #76360 (comment). In both cases, we need to decide how to pass a |
This happens when trying to use
r#Self
as an enum variant on nightly, when the enum is passed through quote! in a proc macro.Code
src/lib.rs:
my_macros/src/lib.rs:
Meta
This only happens on nightly. On stable, it correctly outputs the errors and exits gracefully.
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: