mirror of https://github.com/rust-lang/rust.git
Clean up E0262 explanation
This commit is contained in:
parent
320ada6479
commit
4b0fe2ac63
|
@ -1,8 +1,12 @@
|
||||||
Declaring certain lifetime names in parameters is disallowed. For example,
|
An invalid name was used for a lifetime parameter.
|
||||||
because the `'static` lifetime is a special built-in lifetime name denoting
|
|
||||||
the lifetime of the entire program, this is an error:
|
Erroneous code example:
|
||||||
|
|
||||||
```compile_fail,E0262
|
```compile_fail,E0262
|
||||||
// error, invalid lifetime parameter name `'static`
|
// error, invalid lifetime parameter name `'static`
|
||||||
fn foo<'static>(x: &'static str) { }
|
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:
|
||||||
|
|
Loading…
Reference in New Issue