]>
Commit | Line | Data |
---|---|---|
dfeec247 XL |
1 | An invalid name was used for a lifetime parameter. |
2 | ||
3 | Erroneous code example: | |
60c5eb7d XL |
4 | |
5 | ```compile_fail,E0262 | |
6 | // error, invalid lifetime parameter name `'static` | |
7 | fn foo<'static>(x: &'static str) { } | |
8 | ``` | |
dfeec247 XL |
9 | |
10 | Declaring certain lifetime names in parameters is disallowed. For example, | |
11 | because the `'static` lifetime is a special built-in lifetime name denoting | |
12 | the lifetime of the entire program, this is an error: |