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

Compatability with async_trait #46

Closed
xyjixyjixyji opened this issue Oct 19, 2022 · 2 comments
Closed

Compatability with async_trait #46

xyjixyjixyji opened this issue Oct 19, 2022 · 2 comments

Comments

@xyjixyjixyji
Copy link

xyjixyjixyji commented Oct 19, 2022

When using delegate! under trait attributed by #[async_trait], the expand order matters and it seems cannot compile.
IMO, only when delegate! expands before #[async_trait], can this compile and work correctly.

e.g. this won't compile

#[async_trait]
impl Foo for Bar {
    delegate! {
        to self.inner {
            async fn baz(&self);
        }
    }
}

Is there a way to solve this problem?

@Kobzol
Copy link
Owner

Kobzol commented Oct 22, 2022

@xyjixyjixyji
Copy link
Author

I don't think that this is possible currently (https://stackoverflow.com/questions/62493492/is-is-possible-in-rust-to-invoke-a-macro-in-procedure-macro-code).

Thanks for answering! I guess this problem can only be solved when rust supports sort of macro expand ordering specifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants