]> git.proxmox.com Git - rustc.git/blob - src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / unboxed-closures / unboxed-closures-infer-argument-types-two-region-pointers.rs
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
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
15 pub fn main() {
16 doit(0, &|x, y| {
17 x.set(y);
18 //~^ lifetime may not live long enough
19 });
20 }