-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
error w/ macros that expand into macro definitions #6795
Comments
Good news... after an update, it now provides a nice error message rather than an ICE. It appears that rust does not currently support macros that expand into macro definitions. Specifically:
It appears that macro expansion insists that all identifiers preceded by a $ must be already bound to syntax terms. Fixing this will probably require a bunch of steps. |
update and more detail on this: the central issue here appears to be that macro invocation bodies are "too parsed, too soon." More specifically: macro invocation bodies are not parsed into ASTs, they're kept as token trees. That's good. However, the token tree language is designed to allow these token trees to contain pattern variable references. That is, pattern variables are identified when the macro is parsed into a token tree. This is bad, because you don't yet know whether a given pattern variable is a pattern variable binding or a pattern variable use. I believe the solution is to delay this decision until macro expansion time. |
Visiting for triage; still reproduces. |
Still an issue. |
Now that the ICE has been fixed, is this a dupe of #6994? |
yes, looks that way to me. |
Downgrade manual_map to nursery I believe rust-lang#6795 should be considered a blocker for this lint to be considered for enabling by default. --- changelog: remove manual_map from default list of enabled lints
Fix `manual_map` false positives fixes: rust-lang#6795 fixes: rust-lang#6797 fixes: rust-lang#6811 fixes: rust-lang#6819 changelog: Fix false positives for `manual_map` when `return`, `break`, `continue`, `yield`, `await`, and partially moved values are used. changelog: Don't expand macros in suggestions for `manual_map`
One of my expansion test cases causes an ICE:
=>
before going further, I must check that this happens on incoming as well as my branch....
The text was updated successfully, but these errors were encountered: