-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
ICE with macro defining invalid enum that derives a trait #96818
Comments
Probably a duplicate of #81920 |
Quick question: is this a real world code or just messing around? Because the other one was found using a fuzzer which produces some code and is typically not a high priority. |
It's for a single-use DSL macro I defined in a prototype tokenizer I'm working on. Since type-defining DSLs are generally considered an anti-pattern, I'll point out |
…aron1011 Manually cleanup token stream when macro expansion aborts. In case of syntax error in macro expansion, the expansion code can decide to stop processing anything. In that case, the token stream is malformed. This makes downstream users, like derive macros, ICE. In this case, this PR manually cleans up the token stream by closing all currently open delimiters. Fixes rust-lang#96818. Fixes rust-lang#80447. Fixes rust-lang#81920. Fixes rust-lang#91023.
Manually cleanup token stream when macro expansion aborts. In case of syntax error in macro expansion, the expansion code can decide to stop processing anything. In that case, the token stream is malformed. This makes downstream users, like derive macros, ICE. In this case, this PR manually cleans up the token stream by closing all currently open delimiters. Fixes rust-lang/rust#96818. Fixes rust-lang/rust#80447. Fixes rust-lang/rust#81920. Fixes rust-lang/rust#91023.
Manually cleanup token stream when macro expansion aborts. In case of syntax error in macro expansion, the expansion code can decide to stop processing anything. In that case, the token stream is malformed. This makes downstream users, like derive macros, ICE. In this case, this PR manually cleans up the token stream by closing all currently open delimiters. Fixes rust-lang/rust#96818. Fixes rust-lang/rust#80447. Fixes rust-lang/rust#81920. Fixes rust-lang/rust#91023.
Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: