Rollup merge of #68777 - GuillaumeGomez:clean-up-e0263, r=Dylan-DPC

Clean up E0263 explanation

r? @Dylan-DPC
This commit is contained in:
Dylan DPC 2020-02-03 18:58:32 +01:00 committed by GitHub
commit 51c6c25575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,16 @@
A lifetime name cannot be declared more than once in the same scope. For
example:
A lifetime was declared more than once in the same scope.
Erroneous code example:
```compile_fail,E0263
// error, lifetime name `'a` declared twice in the same scope
fn foo<'a, 'b, 'a>(x: &'a str, y: &'b str) { }
fn foo<'a, 'b, 'a>(x: &'a str, y: &'b str, z: &'a str) { // error!
}
```
Two lifetimes cannot have the same name. To fix this example, change
the second `'a` lifetime into something else (`'c` for example):
```
fn foo<'a, 'b, 'c>(x: &'a str, y: &'b str, z: &'c str) { // ok!
}
```