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