Skip to content
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

[Rust] Support macro repetitions inside structs #3912

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FichteFoll
Copy link
Collaborator

@FichteFoll FichteFoll commented Jan 28, 2024

This only addresses a specific case of macro repetitions inside the struct body and similar changes to other statements with body blocks are likely also necessary, but I'm keeping the change to a limited scope in order to observe its effects first. Further reports of such issues can be handled analogously.

Closes #3904.

This only addresses a specific case of macro repetitions inside the
struct body and similar changes to other statements with body blocks
are likely also necessary, but I'm keeping the change to a limited in
order to observe its effects first. Further reports of such issues can
be handled analogously.
@FichteFoll
Copy link
Collaborator Author

FichteFoll commented Jan 28, 2024

The other reason I didn't do it for other block statements is that I didn't have any (valid) examples at hand to verify with and I'm not comfortable enough with macros to craft them ad-hoc.

`const` and function definitions are not valid inside structs. `impl`
was probably meant here.
@FichteFoll
Copy link
Collaborator Author

This doesn't handle macros like println!($($arg)); or println!($($arg)?); well and I don't really see how it could … Putting the PR on hold for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Rust] Macro improperly marked as invalid
1 participant