forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#68573 - GuillaumeGomez:clean-up-e0262, r=Dy…
…lan-DPC Clean up E0262 explanation r? @Dylan-DPC
- Loading branch information
Showing
1 changed file
with
7 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |