-
Notifications
You must be signed in to change notification settings - Fork 29
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
Support reexporting from anywhere by wrapping in a declarative macro #46
Conversation
As a downside we get slightly worse error messages as the filename and line number will point to the macro definition site instead of the call site.
Why is CI failing? It works on my machine, and we're running the same version of rustc... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I don't think this will work properly if EDIT: #46 (comment)async_stream
(actual path of $crate
) is not included in the direct dependency. I believe you need to use a trick like rust-lang/futures-rs#2124.
In any case, this PR needs a test to make sure reexporting works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is CI failing? It works on my machine, and we're running the same version of rustc...
I'm not sure if it's a trybuild bug or a rustc bug, (sometimes) test results in CI may differ from those run locally...
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'm surprised that this also works with reexport. I think I saw the code generated by --pretty=expanded and misunderstood it didn't work (sorry for the wrong review!).
This PR allows the
stream!
andtry_stream!
macros to be reexported from anywhere by having the procedural macro take a path toasync_stream
, and having the macros inasync-stream
be declarative macros that wrap the procedural ones and pass in$crate
.