-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
axum-debug: Use proc-macro-crate for referencing axum in generated code #507
Conversation
After reading through that issue again I'm no longer certain this is a great idea, since there's so many edge cases all over the place, but with the fallback being the old behavior it can't really do much harm either. Feel free to simply close if you're not convinced that this makes sense. |
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.
Awesome! I didn't know this was a thing.
Ah I didn't read your comment before reviewing. I'm not really familiar with the solution so not sure 🤔 |
Okay, so quick overview: The proc-macro-crate crate does some ugly hacks to support renamed "sibling" crates, i.e. ones that you want to refer to from generated code. The most basic hack is finding the It also does some more checks to see whether maybe the crate currently being compiled is the one you want to refer to, in which case you would usually emit If you feel like supporting |
Alright. If |
That would actually make no difference at all. If somebody. was writing |
Beta build broke because
wasn't expected in trybuild test output. Maybe a new beta was just released that changed sth. there? |
I think we should be a little conservative with this and not merge it. If someone files an issue asking it then we can reconsider. |
Allows users to rename
axum
(say toaxum03
) inCargo.toml
and still haveaxum-debug
work.Would also allow usage of
axum-debug
in axum itself (possibly relevant for in-crate tests) if bkchr/proc-macro-crate#11 were fixed (for this specific case there is a workaround though).