Skip to content

Commit b474a22

Browse files
authored
Merge pull request #421 from danielhenrymantilla/patch-1
Fix (and improve) enum representation of an async fn future
2 parents 67634db + 192ac87 commit b474a22

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

posts/inside-rust/2019-10-11-AsyncAwait-Not-Send-Error-Improvements.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,19 @@ async fn bar(x: &Mutex<u32>) {
122122

123123
```rust
124124
enum BarGenerator {
125-
Unresumed { x: &Mutex<u32>, g: MutexGuard<'_, u32>, },
126-
Suspend0 { x: &Mutex<u32>, g: MutexGuard<'_, u32>, }
125+
// `bar`'s parameters.
126+
Unresumed { x: &Mutex<u32> },
127+
128+
Suspend0 {
129+
// Future returned by `baz`, which is being polled.
130+
baz_future: BazGenerator,
131+
132+
// Locals that are used across the await point.
133+
x: &Mutex<u32>,
134+
g: MutexGuard<'_, u32>,
135+
},
136+
137+
Returned { value: () }
127138
}
128139
```
129140

0 commit comments

Comments
 (0)