]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs
Rollup merge of #87440 - twetzel59:fix-barrier-no-op, r=yaahc
[rust.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); //~ ERROR E0312
18     });
19 }