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

Drop async_trait in favor of native async traits #1229

Open
Tracked by #1292
olanod opened this issue Nov 6, 2023 · 3 comments
Open
Tracked by #1292

Drop async_trait in favor of native async traits #1229

olanod opened this issue Nov 6, 2023 · 3 comments

Comments

@olanod
Copy link

olanod commented Nov 6, 2023

async_fn_in_trait has been stabilized, declaring the crate's traits as "native" async traits can bring some performance benefits or make the code simpler, it could also help to towards a no-alloc version of the crate that works better in embedded devices as futures no longer have to be Boxed.

@niklasad1
Copy link
Member

niklasad1 commented Nov 6, 2023

Yes, we are very exited about it but it's not released in rustc stable yet and last I heard, it's planned to be in the rustc December release.

Once it's in rustc stable we will get rid of the async_trait.
Would also be nice to get rid off the extra async_trait annotations as well as the Boxed futures.

@olanod
Copy link
Author

olanod commented Nov 6, 2023

I think it's worth introducing the the change early as code that uses nightly can already benefit(e.g. runtimes) and the feature will likely be in stable by the time a relevant PR gets merged.

@bkchr
Copy link
Member

bkchr commented Nov 6, 2023

I think it's worth introducing the the change early as code that uses nightly can already benefit(e.g. runtimes) and the feature will likely be in stable by the time a relevant PR gets merged.

We don't use nightly anymore for runtimes and we also don't use async in the runtime. So, no need to "rush". It will come with rust 1.75.0 at 28.12.2023.

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

Successfully merging a pull request may close this issue.

3 participants