summaryrefslogtreecommitdiffstats
path: root/src/test/ui/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.rs
blob: 97d7a51a72bb1814db3167c3d79ab1fd9c933796 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
fn with_closure<F, A, B>(_: F)
    where F: FnOnce(A, B)
{
}

fn a() {
    // Type of `y` is unconstrained.
    with_closure(|x: u32, y| {}); //~ ERROR E0282
}

fn b() {
    with_closure(|x: u32, y: u32| {}); // OK
}

fn c() {
    with_closure(|x: u32, y: u32| {}); // OK
}

fn main() { }