Skip to content

Commit 467b93f

Browse files
authored
Add link for dyn Trait
1 parent 46a4526 commit 467b93f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

posts/inside-rust/2023-05-02-stabilizing-async-fn-in-trait.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,11 @@ In the MVP, traits that use async functions are not "dyn safe", meaning that the
169169

170170
At first, this seems like a crucial limitation, since many of the use cases require dynamic dispatch! But it turns out that there is a workaround. One can define an "erased" trait internally to your crate that enables dynamic dispatch. The process was pioneered by crates like [erased serde] and is explained in detail in the [builder-provider case study].
171171

172-
To make this workaround easier in the near term, we hope to provide a proc macro to automate it. In the future, async fn should work with `dyn Trait` directly.
172+
To make this workaround easier in the near term, we hope to provide a proc macro to automate it. In the future, async fn [should work][ugf-dyn] with `dyn Trait` directly.
173173

174174
[erased serde]: https://github.com/dtolnay/erased-serde
175175
[builder-provider case study]: https://rust-lang.github.io/async-fundamentals-initiative/evaluation/case-studies/builder-provider-api.html#dynamic-dispatch-behind-the-api
176+
[ugf-dyn]: https://rust-lang.github.io/async-fundamentals-initiative/explainer/user_guide_future.html#dynamic-dispatch-and-async-functions
176177

177178
### Send bounds are verbose, especially for traits with lots of methods
178179

0 commit comments

Comments
 (0)