1 error[E0308]: `match` arms have incompatible types
2 --> $DIR/closure_cap_coerce_many_fail.rs:9:16
4 LL | let _ = match "+" {
7 | | --- this is found to be of type `fn(i32, i32) -> i32 {add}`
8 LL | | "-" => |a, b| (a - b + cap) as i32,
9 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found closure
10 LL | | _ => unimplemented!(),
12 | |_____- `match` arms have incompatible types
14 = note: expected type `fn(i32, i32) -> i32 {add}`
15 found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:9:16: 9:43]`
17 error[E0308]: `match` arms have incompatible types
18 --> $DIR/closure_cap_coerce_many_fail.rs:18:16
20 LL | let _ = match "+" {
22 LL | | "+" => |a, b| (a + b) as i32,
23 | | --------------------- this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:17:16: 17:37]`
24 LL | | "-" => |a, b| (a - b + cap) as i32,
25 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
26 LL | | _ => unimplemented!(),
28 | |_____- `match` arms have incompatible types
30 = note: expected type `[closure@$DIR/closure_cap_coerce_many_fail.rs:17:16: 17:37]`
31 found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:18:16: 18:43]`
32 = note: no two closures, even if identical, have the same type
33 = help: consider boxing your closure and/or using it as a trait object
35 error[E0308]: `match` arms have incompatible types
36 --> $DIR/closure_cap_coerce_many_fail.rs:27:16
38 LL | let _ = match "+" {
40 LL | | "+" => |a, b| (a + b + cap) as i32,
41 | | --------------------------- this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:43]`
42 LL | | "-" => |a, b| (a - b) as i32,
43 | | ^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
44 LL | | _ => unimplemented!(),
46 | |_____- `match` arms have incompatible types
48 = note: expected type `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:43]`
49 found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:27:16: 27:37]`
50 = note: no two closures, even if identical, have the same type
51 = help: consider boxing your closure and/or using it as a trait object
53 error[E0308]: `match` arms have incompatible types
54 --> $DIR/closure_cap_coerce_many_fail.rs:35:16
56 LL | let _ = match "+" {
58 LL | | "+" => |a, b| (a + b + cap) as i32,
59 | | --------------------------- this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:43]`
60 LL | | "-" => |a, b| (a - b + cap) as i32,
61 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
62 LL | | _ => unimplemented!(),
64 | |_____- `match` arms have incompatible types
66 = note: expected type `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:43]`
67 found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:35:16: 35:43]`
68 = note: no two closures, even if identical, have the same type
69 = help: consider boxing your closure and/or using it as a trait object
71 error: aborting due to 4 previous errors
73 For more information about this error, try `rustc --explain E0308`.