]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0263.md
Auto merge of #92353 - Kobzol:doc-attr-lists-gat, r=GuillaumeGomez
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0263.md
1 A lifetime was declared more than once in the same scope.
2
3 Erroneous code example:
4
5 ```compile_fail,E0263
6 fn foo<'a, 'b, 'a>(x: &'a str, y: &'b str, z: &'a str) { // error!
7 }
8 ```
9
10 Two lifetimes cannot have the same name. To fix this example, change
11 the second `'a` lifetime into something else (`'c` for example):
12
13 ```
14 fn foo<'a, 'b, 'c>(x: &'a str, y: &'b str, z: &'c str) { // ok!
15 }
16 ```