Skip to content

Commit e224ead

Browse files
authored
Merge pull request #180 from harryhaaren/async_in_trait_update
07 workarounds/async in trait: update that nightly has mvp
2 parents 81c03c2 + 273aa2d commit e224ead

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/07_workarounds/05_async_in_traits.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# `async` in Traits
22

3-
Currently, `async fn` cannot be used in traits. The reasons for this are
4-
somewhat complex, but there are plans to remove this restriction in the
5-
future.
3+
Currently, `async fn` cannot be used in traits on the stable release of Rust.
4+
Since the 17th November 2022, an MVP of async-fn-in-trait is available on the nightly
5+
version of the compiler tool chain, [see here for details](https://blog.rust-lang.org/inside-rust/2022/11/17/async-fn-in-trait-nightly.html).
66

7-
In the meantime, however, this can be worked around using the
7+
In the meantime, there is a work around for the stable tool chain using the
88
[async-trait crate from crates.io](https://github.com/dtolnay/async-trait).
99

1010
Note that using these trait methods will result in a heap allocation

0 commit comments

Comments
 (0)