]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0688.md
Rollup merge of #93400 - ChayimFriedman2:dont-suggest-using-const-with-bounds-unused...
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0688.md
1 #### Note: this error code is no longer emitted by the compiler.
2
3 In-band lifetimes were mixed with explicit lifetime binders.
4
5 Erroneous code example:
6
7 ```ignore (feature got removed)
8 #![feature(in_band_lifetimes)]
9
10 fn foo<'a>(x: &'a u32, y: &'b u32) {}   // error!
11
12 struct Foo<'a> { x: &'a u32 }
13
14 impl Foo<'a> {
15     fn bar<'b>(x: &'a u32, y: &'b u32, z: &'c u32) {}   // error!
16 }
17
18 impl<'b> Foo<'a> {  // error!
19     fn baz() {}
20 }
21 ```
22
23 In-band lifetimes cannot be mixed with explicit lifetime binders.
24 For example:
25
26 ```
27 fn foo<'a, 'b>(x: &'a u32, y: &'b u32) {}   // ok!
28
29 struct Foo<'a> { x: &'a u32 }
30
31 impl<'a> Foo<'a> {
32     fn bar<'b,'c>(x: &'a u32, y: &'b u32, z: &'c u32) {}    // ok!
33 }
34
35 impl<'a> Foo<'a> {  // ok!
36     fn baz() {}
37 }
38 ```