File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ Async contexts are established by async blocks as well as the bodies of async fu
103103
104104Async blocks act like a function boundary, much like closures.
105105Therefore, the `?` operator and `return` expressions both affect the output of the future, not the enclosing function or other context.
106- That is, `return <expr>` from within a closure will return the result of `<expr>` as the output of the future.
106+ That is, `return <expr>` from within an async block will return the result of `<expr>` as the output of the future.
107107Similarly, if `<expr>?` propagates an error, that error is propagated as the result of the future.
108108
109109Finally, the `break` and `continue` keywords cannot be used to branch out from an async block.
@@ -112,7 +112,7 @@ Therefore the following is illegal:
112112```rust,compile_fail
113113loop {
114114 async move {
115- break; // This would break out of the loop.
115+ break; // error[E0267]: ` break` inside of an `async` block
116116 }
117117}
118118```
You can’t perform that action at this time.
0 commit comments