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

Fix code generation for macro calls that store args in variables. #499

Merged
merged 1 commit into from
Jun 22, 2021

Conversation

rfk
Copy link
Contributor

@rfk rfk commented Jun 21, 2021

This fixes #498 for me locally. I don't know enough about the codebase to know how to write a good test for this or whether there's a cleaner way to fix it. But I'll be happy to polish this up a bit if you can give me a few pointers.

@djc
Copy link
Owner

djc commented Jun 21, 2021

Thanks for fixing this! The fix itself seems fine.

There are integration tests in the testing crate, should be easy to copy your reproducer in there. Probably put this in the macro module.

(Maybe also shorten the commit message little bit so it fits in one line?)

@rfk
Copy link
Contributor Author

rfk commented Jun 22, 2021

There are integration tests in the testing crate, should be easy to copy your reproducer in there.
Probably put this in the macro module.

Sounds good, I should be able to make time to revisit this in the next couple of days.

@rfk rfk force-pushed the i498-macro-call-variables-fix branch 3 times, most recently from 91088fc to 04364da Compare June 22, 2021 08:20
@rfk rfk force-pushed the i498-macro-call-variables-fix branch from 04364da to 374b7bb Compare June 22, 2021 08:21
@rfk
Copy link
Contributor Author

rfk commented Jun 22, 2021

Updated with a test (which I confirmed fails on current main) and a briefer commit message.

@rfk rfk changed the title Fix code generation when initial macro call args are already in variables Fix code generation for macro calls that store args in variables. Jun 22, 2021
@djc djc merged commit 49252d2 into djc:main Jun 22, 2021
@djc
Copy link
Owner

djc commented Jun 22, 2021

Thanks!

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.

Error "proc-macro derive produced unparseable tokens" with nested macro call
2 participants