summaryrefslogtreecommitdiffstats
path: root/tests/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.rs
blob: 2236d78ef4b128786ff011eb9f4268b6640181af (plain)
1
2
3
4
5
6
7
8
9
10
11
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 z = Ref { data: y.data };
    x.push(z);
    //~^ ERROR lifetime may not live long enough
}

fn main() { }