1 fn add(a: i32, b: i32) -> i32 {
5 // We shouldn't coerce capturing closure to a function
9 "-" => |a, b| (a - b + cap) as i32,
10 _ => unimplemented!(),
12 //~^^^ ERROR `match` arms have incompatible types
15 // We shouldn't coerce capturing closure to a non-capturing closure
17 "+" => |a, b| (a + b) as i32,
18 "-" => |a, b| (a - b + cap) as i32,
19 _ => unimplemented!(),
21 //~^^^ ERROR `match` arms have incompatible types
24 // We shouldn't coerce non-capturing closure to a capturing closure
26 "+" => |a, b| (a + b + cap) as i32,
27 "-" => |a, b| (a - b) as i32,
28 _ => unimplemented!(),
30 //~^^^ ERROR `match` arms have incompatible types
32 // We shouldn't coerce capturing closure to a capturing closure
34 "+" => |a, b| (a + b + cap) as i32,
35 "-" => |a, b| (a - b + cap) as i32,
36 _ => unimplemented!(),
38 //~^^^ ERROR `match` arms have incompatible types