]> git.proxmox.com Git - rustc.git/blob - src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr
New upstream version 1.20.0+dfsg1
[rustc.git] / src / test / ui / lifetime-errors / ex2c-push-inference-variable.stderr
1 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
2 --> $DIR/ex2c-push-inference-variable.rs:16:13
3 |
4 16 | let z = Ref { data: y.data };
5 | ^^^
6 |
7 note: first, the lifetime cannot outlive the lifetime 'c as defined on the function body at 15:1...
8 --> $DIR/ex2c-push-inference-variable.rs:15:1
9 |
10 15 | / fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
11 16 | | let z = Ref { data: y.data };
12 17 | | x.push(z);
13 18 | | }
14 | |_^
15 note: ...so that reference does not outlive borrowed content
16 --> $DIR/ex2c-push-inference-variable.rs:16:25
17 |
18 16 | let z = Ref { data: y.data };
19 | ^^^^^^
20 note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 15:1...
21 --> $DIR/ex2c-push-inference-variable.rs:15:1
22 |
23 15 | / fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
24 16 | | let z = Ref { data: y.data };
25 17 | | x.push(z);
26 18 | | }
27 | |_^
28 note: ...so that expression is assignable (expected Ref<'b, _>, found Ref<'_, _>)
29 --> $DIR/ex2c-push-inference-variable.rs:17:12
30 |
31 17 | x.push(z);
32 | ^
33
34 error: aborting due to previous error
35