You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/expressions/block-expr.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -122,14 +122,14 @@ loop {
122
122
Auto trait inference for `async` blocks follow the same [rules as closures] except that [temporary values that are in scope][temporary-scopes] at an `await` expression are also considered. For example, consider the following block:
123
123
124
124
```rust
125
-
#fnbar() ->i32 { 42 }
126
-
#asyncfnfoo() {}
125
+
#fnbar() ->i32 { 42 }
126
+
#asyncfnfoo() {}
127
127
async {
128
128
matchbar() {
129
129
_=>foo().await,
130
130
}
131
131
}
132
-
#;
132
+
#;
133
133
```
134
134
135
135
Here the result of `bar()` is in scope during the await of `foo()`, so the result of `bar()` will impact the inferred auto traits.
0 commit comments