summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs
blob: 6765da42132b7688809486cd1039d80dcf8ddd12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#![feature(fn_traits)]

// That a closure whose expected argument types include two distinct
// bound regions.

use std::cell::Cell;

fn doit<T,F>(val: T, f: &F)
    where F : Fn(&Cell<&T>, &T)
{
    let x = Cell::new(&val);
    f.call((&x,&val))
}

pub fn main() {
    doit(0, &|x, y| {
        x.set(y);
        //~^ lifetime may not live long enough
    });
}