Skip to content

Commit 4b0fe2a

Browse files
Clean up E0262 explanation
1 parent 320ada6 commit 4b0fe2a

File tree

1 file changed

+7
-3
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+7
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
Declaring certain lifetime names in parameters is disallowed. For example,
2-
because the `'static` lifetime is a special built-in lifetime name denoting
3-
the lifetime of the entire program, this is an error:
1+
An invalid name was used for a lifetime parameter.
2+
3+
Erroneous code example:
44

55
```compile_fail,E0262
66
// error, invalid lifetime parameter name `'static`
77
fn foo<'static>(x: &'static str) { }
88
```
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:

0 commit comments

Comments
 (0)