]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr
Fix invalid associated type rendering in rustdoc
[rust.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 body at 15:66...
8   --> $DIR/ex2c-push-inference-variable.rs:15:67
9    |
10 15 |   fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
11    |  ___________________________________________________________________^ starting here...
12 16 | |     let z = Ref { data: y.data };
13 17 | |     x.push(z);
14 18 | | }
15    | |_^ ...ending here
16 note: ...so that reference does not outlive borrowed content
17   --> $DIR/ex2c-push-inference-variable.rs:16:25
18    |
19 16 |     let z = Ref { data: y.data };
20    |                         ^^^^^^
21 note: but, the lifetime must be valid for the lifetime 'b as defined on the body at 15:66...
22   --> $DIR/ex2c-push-inference-variable.rs:15:67
23    |
24 15 |   fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
25    |  ___________________________________________________________________^ starting here...
26 16 | |     let z = Ref { data: y.data };
27 17 | |     x.push(z);
28 18 | | }
29    | |_^ ...ending here
30 note: ...so that expression is assignable (expected Ref<'b, i32>, found Ref<'_, i32>)
31   --> $DIR/ex2c-push-inference-variable.rs:17:12
32    |
33 17 |     x.push(z);
34    |            ^
35
36 error: aborting due to previous error
37