-
Notifications
You must be signed in to change notification settings - Fork 47
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
Exported rstest_reuse template cannot be defined at the top level #175
Comments
Playing with macros is tricky and I cannot recognize that the template is in a module or not in the procedural macro so I cannot change the behavior of |
I see, that's a tricky situation. There are workarounds floating around like |
Ok, I decided for a breaking change and stop to support the Export at the root now works and I avoided to introduce a new wired syntax like |
I hope to publish the new version for the end of the week.... |
Done 🎆 |
The above fails to compile because it says
top_level
is defined multiple times. I think one is the function that I wrote, and the other is the macro defined byrstest_reuse
. It's not a big problem since it's easy to move the definition inside a module.https://www.rustexplorer.com/b#%2F*%0A%5Bdependencies%5D%0Arstest%20%3D%20%22*%22%0Arstest_reuse%20%3D%20%22*%22%0A*%2F%0A%0Ause%20rstest%3A%3Arstest%3B%0Ause%20rstest_reuse%3A%3Atemplate%3B%0A%0A%23%5Btemplate%5D%0A%23%5Bexport%5D%0A%23%5Brstest%5D%0Afn%20top_level()%20%7B%0A%7D%0A%2F%2F%20Fails%20with%3A%20the%20name%20%60top_level%60%20is%20defined%20multiple%20times%0A%0Afn%20main()%20%7B%0A%20%20%20%20println!(%22%22)%3B%0A%7D
The text was updated successfully, but these errors were encountered: