Skip to content

Commit

Permalink
Rollup merge of rust-lang#68573 - GuillaumeGomez:clean-up-e0262, r=Dy…
Browse files Browse the repository at this point in the history
…lan-DPC

Clean up E0262 explanation

r? @Dylan-DPC
  • Loading branch information
JohnTitor authored Jan 28, 2020
2 parents 8bc0e48 + 4b0fe2a commit ee79cf2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/librustc_error_codes/error_codes/E0262.md
Original file line number Diff line number Diff line change
@@ -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:

0 comments on commit ee79cf2

Please sign in to comment.