]> git.lizzy.rs Git - rust.git/commitdiff
Clean up E0733 explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sun, 26 Jul 2020 15:38:47 +0000 (17:38 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Sun, 2 Aug 2020 11:24:40 +0000 (13:24 +0200)
src/librustc_error_codes/error_codes/E0733.md

index 0bda7a7d68283db5baa0077765b7748bee33fb84..051b75148e5095df27ca39b1dd4f96b345e9b120 100644 (file)
@@ -1,4 +1,6 @@
-Recursion in an `async fn` requires boxing. For example, this will not compile:
+An [`async`] function used recursion without boxing.
+
+Erroneous code example:
 
 ```edition2018,compile_fail,E0733
 async fn foo(n: usize) {
@@ -8,8 +10,8 @@ async fn foo(n: usize) {
 }
 ```
 
-To achieve async recursion, the `async fn` needs to be desugared
-such that the `Future` is explicit in the return type:
+To perform async recursion, the `async fn` needs to be desugared such that the
+`Future` is explicit in the return type:
 
 ```edition2018,compile_fail,E0720
 use std::future::Future;
@@ -36,5 +38,7 @@ fn foo_recursive(n: usize) -> Pin<Box<dyn Future<Output = ()>>> {
 }
 ```
 
-The `Box<...>` ensures that the result is of known size,
-and the pin is required to keep it in the same place in memory.
+The `Box<...>` ensures that the result is of known size, and the pin is
+required to keep it in the same place in memory.
+
+[`async`]: https://doc.rust-lang.org/std/keyword.async.html