-
Notifications
You must be signed in to change notification settings - Fork 240
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
How to handle async-traits with external types #2423
base: main
Are you sure you want to change the base?
Conversation
external types have had many many changes since 0.28 - are you able to test against |
(oops, actually, I see you are, sorry about that!) |
The problem here is that the type isn't being "used" by the lib crate - eg, adding this:
to the proc-macro crate is enough to make it work. This is clearly a bug though, but sadly it's not immediately obvious how to fix it in a reasonable way, so in the meantime this might be an OK work-around? (Also note this has nothing to do with async, it's just about objects implementing traits) |
and for someone in the future looking at actually fixing it - I think what we need is somehow to call |
I have added usage, both in the lib and the proc-macro lib, but this still fails |
Ouch, yeah - this is failing for Swift for a similar reason to what I wrote above - the "lib" crate is trying to find out information about the trait, but because the trait is defined in a different module it can't find info about it. I think the correct answer here is to have each CI somehow arrange to share this info, but it's not a trivial change. |
I have been trying to get external types, combined with async trait implementations to work, and created this failing test to show how far I ave come. I don't know if this is missing something fundamental, or if I am setting it up wrong. I would appreciate any pointers.
This fails with