Skip to content

Commit 273aa2d

Browse files
committed
07 workarounds/async in trait: update that nightly has mvp
Signed-off-by: Harry van Haaren <[email protected]>
1 parent 81c03c2 commit 273aa2d

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)