Skip to content

Commit 90a8281

Browse files
authored
Address eholk feedback
1 parent 3a2aa09 commit 90a8281

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ trait LaunchService {
125125
}
126126
```
127127

128-
Since `async fn` is sugar for a regular function returning `impl Future`, these two syntactic forms will work interchangeably.
128+
Since `async fn` is sugar for a regular function returning `impl Future`, these two syntactic forms will work interchangeably.[^afit-rpitit]
129+
130+
[^afit-rpitit]: The ability to satisfy an `async fn` in a trait with a regular function returning `impl Future` in an impl, and vice versa, is part of [RFC 3425]. It was not in the [original RFC][RFC 3185] for `async fn` in traits, simply because `-> impl Trait` in traits was not supported then.
129131

130132
```rust
131133
trait HealthCheck {
@@ -139,7 +141,7 @@ impl HealthCheck for MyType {
139141

140142
Even though the need for "impl trait in traits" comes up a lot in async, they are a general feature that will be useful in many contexts having nothing to do with async (for example, returning iterators from trait methods).
141143

142-
**Status:** Return-position impl trait in traits have an experimental implementation and are described in the recently opened [RFC 3425].
144+
**Status:** Return-position impl trait in traits have an experimental implementation and are described in [RFC 3425], which is currently open. This feature can stand on its own, but is an important part of the picture for `async fn` in traits.
143145

144146
[Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=75cfc199cc50a111576c2d8e342ae823)
145147

0 commit comments

Comments
 (0)