summaryrefslogtreecommitdiffstats
path: root/tests/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.rs
blob: 4a934bbf080d505d2a60595e267c705f2a007b44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
struct Ref<'a, T: 'a> {
    data: &'a T
}

fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
    let a: &mut Vec<Ref<i32>> = x;
    let b = Ref { data: y.data };
    Vec::push(a, b);
    //~^ ERROR lifetime may not live long enough
}

fn main() { }