mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Update error code documentation.
This commit is contained in:
parent
289216f281
commit
c6a3f5d606
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user