Skip to content

Commit 61fbe57

Browse files
Clean up E0581 explanation
1 parent 97f3eee commit 61fbe57

File tree

1 file changed

+6
-3
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+6
-3
lines changed

src/librustc_error_codes/error_codes/E0581.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
In a `fn` type, a lifetime appears only in the return type,
1+
In a `fn` type, a lifetime appears only in the return type
22
and not in the arguments types.
33

44
Erroneous code example:
@@ -10,8 +10,11 @@ fn main() {
1010
}
1111
```
1212

13-
To fix this issue, either use the lifetime in the arguments, or use
14-
`'static`. Example:
13+
The problem here is that the lifetime isn't contrained by any of the arguments,
14+
making it impossible to determine how long it's supposed to live.
15+
16+
To fix this issue, either use the lifetime in the arguments, or use the
17+
`'static` lifetime. Example:
1518

1619
```
1720
fn main() {

0 commit comments

Comments
 (0)