]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_error_codes/src/error_codes/E0688.md
New upstream version 1.61.0+dfsg1
[rustc.git] / compiler / rustc_error_codes / src / error_codes / E0688.md
CommitLineData
5e7ed085
FG
1#### Note: this error code is no longer emitted by the compiler.
2
f035d41b
XL
3In-band lifetimes were mixed with explicit lifetime binders.
4
5Erroneous code example:
6
5e7ed085 7```ignore (feature got removed)
f035d41b
XL
8#![feature(in_band_lifetimes)]
9
10fn foo<'a>(x: &'a u32, y: &'b u32) {} // error!
11
12struct Foo<'a> { x: &'a u32 }
13
14impl Foo<'a> {
15 fn bar<'b>(x: &'a u32, y: &'b u32, z: &'c u32) {} // error!
16}
17
18impl<'b> Foo<'a> { // error!
19 fn baz() {}
20}
21```
22
23In-band lifetimes cannot be mixed with explicit lifetime binders.
24For example:
25
26```
27fn foo<'a, 'b>(x: &'a u32, y: &'b u32) {} // ok!
28
29struct Foo<'a> { x: &'a u32 }
30
31impl<'a> Foo<'a> {
32 fn bar<'b,'c>(x: &'a u32, y: &'b u32, z: &'c u32) {} // ok!
33}
34
35impl<'a> Foo<'a> { // ok!
36 fn baz() {}
37}
38```