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

Unwrap argument types in macro #3625

Merged
merged 7 commits into from Sep 20, 2023
Merged

Conversation

snOm3ad
Copy link
Contributor

@snOm3ad snOm3ad commented Sep 19, 2023

syn wraps argument types in a syn::TypeGroup for free functions/methods generated from macro_rules! this means that references end up generating wrong code during proc macro expansion.

This PR unwraps argument types in syn::TypeGroup and matches against the inner element for such cases.

Fixes #3078

`syn` wraps argument types in a `syn::TypeGroup` for free
functions/methods generated from `macro_rules!` this means that
references end up generating wrong code during proc macro expansion.

This PR unwraps argument types in `syn::TypeGroup` and matches against
the inner element for such cases.

Fixes rustwasm#3078

Signed-off-by: Oliver T <geronimooliver00@gmail.com>
Signed-off-by: Oliver T <geronimooliver00@gmail.com>
Signed-off-by: Oliver T <geronimooliver00@gmail.com>
Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test for this?

Signed-off-by: Oliver T <geronimooliver00@gmail.com>
Signed-off-by: Oliver T <geronimooliver00@gmail.com>
Signed-off-by: Oliver T <geronimooliver00@gmail.com>
Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Signed-off-by: Oliver T <geronimooliver00@gmail.com>
@daxpedda daxpedda merged commit 4bafdbe into rustwasm:main Sep 20, 2023
25 checks passed
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.

Macro expansion code, export function parameter is &T
3 participants