From c6a3f5d6062f55779e52de24a6465cf87ffbdd19 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Mon, 27 Dec 2021 18:14:27 +0100 Subject: [PATCH] Update error code documentation. --- compiler/rustc_error_codes/src/error_codes/E0760.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0760.md b/compiler/rustc_error_codes/src/error_codes/E0760.md index e1dcfefebcd..65acd4fabdf 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0760.md +++ b/compiler/rustc_error_codes/src/error_codes/E0760.md @@ -1,4 +1,4 @@ -`async fn`/`impl trait` return type cannot contain a projection +`impl trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope. Erroneous code example: @@ -7,7 +7,7 @@ Erroneous code example: struct S<'a>(&'a i32); impl<'a> S<'a> { - async fn new(i: &'a i32) -> Self { + fn new(i: &'a i32) -> impl Into { S(&22) } } @@ -19,7 +19,7 @@ To fix this error we need to spell out `Self` to `S<'a>`: struct S<'a>(&'a i32); impl<'a> S<'a> { - async fn new(i: &'a i32) -> S<'a> { + fn new(i: &'a i32) -> impl Into> { S(&22) } }