]> git.proxmox.com Git - rustc.git/blame - src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / lifetimes / lifetime-errors / ex2e-push-inference-variable-3.rs
CommitLineData
32a655c1
SL
1struct Ref<'a, T: 'a> {
2 data: &'a T
a7813a04
XL
3}
4
32a655c1 5fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
923072b8 6 let a: &mut Vec<Ref<i32>> = x;
32a655c1
SL
7 let b = Ref { data: y.data };
8 Vec::push(a, b);
923072b8 9 //~^ ERROR lifetime may not live long enough
54a0048b 10}
3157f602 11
32a655c1 12fn main() { }