diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-12-27 18:14:27 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-02-12 01:26:17 +0100 |
| commit | c6a3f5d6062f55779e52de24a6465cf87ffbdd19 (patch) | |
| tree | 5e4b9e4a53cc552c3e1183ae15c6d6d6d85bf214 /compiler/rustc_error_codes/src | |
| parent | 289216f281b136e905aef7f3e825b35ff05fb422 (diff) | |
| download | rust-c6a3f5d6062f55779e52de24a6465cf87ffbdd19.tar.gz rust-c6a3f5d6062f55779e52de24a6465cf87ffbdd19.zip | |
Update error code documentation.
Diffstat (limited to 'compiler/rustc_error_codes/src')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0760.md | 6 |
1 files 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<Self> { 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<'a>> { S(&22) } } |
