-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Allow [] for macro invocation in item
places
#35833
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
cc @rust-lang/lang especially @nrc ; are we okay with this generalization to macro syntax? |
We should not do this. Macro use syntax follows from the regular syntax allowed in that context - so macros in statement position need a |
Interesting, I wasn't aware of that symmetry between macros and their resolved forms. I'm happy either way, but as a counter-point argument for allowing Feel free to close this PR if you want to stick with the restricted syntax. |
☔ The latest upstream changes (presumably #36764) made this pull request unmergeable. Please resolve the merge conflicts. |
I agree that the intention was basically to mirror existing forms (e.g., tuple structs) and that extending to |
@rfcbot fcp close |
oh ha ha this is the rust repo, so rfcbot is irrelevant (or maybe something will happen ... in .... time ....) |
This seems like a sufficiently significant change that it would require an RFC. (you are welcome to compose such an RFC, but the lang team currently does not seem terribly disposed to the idea, so you should probably first see about building up a solid argument for it, perhaps via community discussion either on the IRC channels or in the internals.rust-lang.org forum.) |
FCP proposed with disposition to close. Review requested from: No concerns currently listed. |
@rfcbot fcp cancel |
@nikomatsakis FCP proposal cancelled. |
The following code doesn't compile:
With the following compliant:
It seems that, unlike in
expr
position,item
macros couldn't be invoked withname![...]
. This seems to be caused by a copy-paste issue, where the "could this be a macro" test is repeated in various places but with slightly different logic in each.