Clean up E0262 explanation

This commit is contained in:
Guillaume Gomez 2020-01-27 17:43:02 +01:00
parent 320ada6479
commit 4b0fe2ac63
1 changed files with 7 additions and 3 deletions

View File

@ -1,8 +1,12 @@
Declaring certain lifetime names in parameters is disallowed. For example,
because the `'static` lifetime is a special built-in lifetime name denoting
the lifetime of the entire program, this is an error:
An invalid name was used for a lifetime parameter.
Erroneous code example:
```compile_fail,E0262
// error, invalid lifetime parameter name `'static`
fn foo<'static>(x: &'static str) { }
```
Declaring certain lifetime names in parameters is disallowed. For example,
because the `'static` lifetime is a special built-in lifetime name denoting
the lifetime of the entire program, this is an error: