about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-02-10 12:24:30 +0900
committerGitHub <noreply@github.com>2021-02-10 12:24:30 +0900
commit2e8e591a16a2ced9715c4f93cd0c3b3fdf82b712 (patch)
treefd4b9a8f4d3bb85d9d17587c975d424234115c6d /compiler
parent40fa6fc43f1c78153ad2ea3feef2478cc0ce9102 (diff)
parent4af417a78a1684e2c75b275ee3a0db8049ef8b0f (diff)
downloadrust-2e8e591a16a2ced9715c4f93cd0c3b3fdf82b712.tar.gz
rust-2e8e591a16a2ced9715c4f93cd0c3b3fdf82b712.zip
Rollup merge of #81926 - henryboisdequin:fix-81907, r=estebank
add suggestion to use the `async_recursion` crate

Closes #81907

CC `@estebank`
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_typeck/src/check/check.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_typeck/src/check/check.rs b/compiler/rustc_typeck/src/check/check.rs
index 5f27355f0ba..114fe969edd 100644
--- a/compiler/rustc_typeck/src/check/check.rs
+++ b/compiler/rustc_typeck/src/check/check.rs
@@ -1505,6 +1505,9 @@ fn async_opaque_type_cycle_error(tcx: TyCtxt<'tcx>, span: Span) {
     struct_span_err!(tcx.sess, span, E0733, "recursion in an `async fn` requires boxing")
         .span_label(span, "recursive `async fn`")
         .note("a recursive `async fn` must be rewritten to return a boxed `dyn Future`")
+        .note(
+            "consider using the `async_recursion` crate: https://crates.io/crates/async_recursion",
+        )
         .emit();
 }