Skip to content

Commit c6a3f5d

Browse files
committed
Update error code documentation.
1 parent 289216f commit c6a3f5d

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+3
-3
lines changed

compiler/rustc_error_codes/src/error_codes/E0760.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
`async fn`/`impl trait` return type cannot contain a projection
1+
`impl trait` return type cannot contain a projection
22
or `Self` that references lifetimes from a parent scope.
33

44
Erroneous code example:
@@ -7,7 +7,7 @@ Erroneous code example:
77
struct S<'a>(&'a i32);
88
99
impl<'a> S<'a> {
10-
async fn new(i: &'a i32) -> Self {
10+
fn new(i: &'a i32) -> impl Into<Self> {
1111
S(&22)
1212
}
1313
}
@@ -19,7 +19,7 @@ To fix this error we need to spell out `Self` to `S<'a>`:
1919
struct S<'a>(&'a i32);
2020
2121
impl<'a> S<'a> {
22-
async fn new(i: &'a i32) -> S<'a> {
22+
fn new(i: &'a i32) -> impl Into<S<'a>> {
2323
S(&22)
2424
}
2525
}

0 commit comments

Comments
 (0)