1 #![feature(fn_traits)]
2 
3 // That a closure whose expected argument types include two distinct
4 // bound regions.
5 
6 use std::cell::Cell;
7 
doit<T,F>(val: T, f: &F) where F : Fn(&Cell<&T>, &T)8 fn doit<T,F>(val: T, f: &F)
9     where F : Fn(&Cell<&T>, &T)
10 {
11     let x = Cell::new(&val);
12     f.call((&x,&val))
13 }
14 
main()15 pub fn main() {
16     doit(0, &|x, y| {
17         x.set(y); //~ ERROR E0312
18     });
19 }
20