summary refs log tree commit diff
path: root/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.rs
blob: 7f15aee5f08e4b594a22a22b2baabc19ddc1d347 (plain)
1
2
3
4
5
6
7
8
9
10
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 mismatch
}

fn main() { }