Rollup merge of #72137 - GuillaumeGomez:cleanup-e0581, r=Dylan-DPC

Clean up E0581 explanation

r? @Dylan-DPC
This commit is contained in:
Ralf Jung 2020-05-14 10:22:55 +02:00 committed by GitHub
commit 0b8b38c4c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
In a `fn` type, a lifetime appears only in the return type,
In a `fn` type, a lifetime appears only in the return type
and not in the arguments types.
Erroneous code example:
@ -10,8 +10,11 @@ fn main() {
}
```
To fix this issue, either use the lifetime in the arguments, or use
`'static`. Example:
The problem here is that the lifetime isn't contrained by any of the arguments,
making it impossible to determine how long it's supposed to live.
To fix this issue, either use the lifetime in the arguments, or use the
`'static` lifetime. Example:
```
fn main() {