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

Use the proper grammar for path fragments in macro_rules! #5359

Merged
merged 2 commits into from May 12, 2020
Merged

Use the proper grammar for path fragments in macro_rules! #5359

merged 2 commits into from May 12, 2020

Conversation

mrobakowski
Copy link
Contributor

This PR changes the grammar used by the macro expander to match on path fragments. The Rust Reference specifies that a path fragment should be parsed as a type-like path:

Before this PR value-like paths were used, which caused some macros to fail to expand.

Closes #5357

@Undin Undin added the fix Pull requests that fix some bug(s) label May 12, 2020
@Undin Undin added this to In Progress in To test via automation May 12, 2020
@vlad20012
Copy link
Member

vlad20012 commented May 12, 2020

Wow, nice catch! 👍 Thanks!

Please, bump MacroExpander.EXPANDER_VERSION number. It is used to force macro re-expansion if the expansion mechanism is changed.

@vlad20012
Copy link
Member

bors r+

@Undin Undin added this to the v123 milestone May 12, 2020
@bors
Copy link
Contributor

bors bot commented May 12, 2020

@bors bors bot merged commit c7d035a into intellij-rust:master May 12, 2020
To test automation moved this from In Progress to Test May 12, 2020
@Undin
Copy link
Member

Undin commented May 12, 2020

@mrobakowski Welcome to IntelliJ Rust contributors!

@mrobakowski
Copy link
Contributor Author

@Undin glad to be here. This project makes my life so much easier, so I'm happy I could help even a little bit ❤️

@lancelote lancelote moved this from Test to Done in To test May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull requests that fix some bug(s)
Projects
To test
  
Done
Development

Successfully merging this pull request may close these issues.

Macros with path fragments fail to expand if the path has a non-turbofish generic
3 participants