]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0262.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0262.md
1 An invalid name was used for a lifetime parameter.
2
3 Erroneous code example:
4
5 ```compile_fail,E0262
6 // error, invalid lifetime parameter name `'static`
7 fn foo<'static>(x: &'static str) { }
8 ```
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: