diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-02-03 18:58:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-03 18:58:32 +0100 |
| commit | 51c6c2557584bbf64c0c8e7650596eccf7c1e222 (patch) | |
| tree | a25bae14f101f464ed61ed1c30e8b882ea316aeb /src/librustc_error_codes | |
| parent | 95d1f6ffcded1927fe1e735f1f187dcc40956c78 (diff) | |
| parent | 019ca55b45f0b4e1de74c19bca06c20134ac9103 (diff) | |
| download | rust-51c6c2557584bbf64c0c8e7650596eccf7c1e222.tar.gz rust-51c6c2557584bbf64c0c8e7650596eccf7c1e222.zip | |
Rollup merge of #68777 - GuillaumeGomez:clean-up-e0263, r=Dylan-DPC
Clean up E0263 explanation r? @Dylan-DPC
Diffstat (limited to 'src/librustc_error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0263.md | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/librustc_error_codes/error_codes/E0263.md b/src/librustc_error_codes/error_codes/E0263.md index bb4da43b3f5..37271ac692d 100644 --- a/src/librustc_error_codes/error_codes/E0263.md +++ b/src/librustc_error_codes/error_codes/E0263.md @@ -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! +} ``` |
