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 fn item `fn(i32, i32) -> i32 {add}`
15 found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:9:16: 9:22]`
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 | | ---------------------
25 | | the expected closure
26 | | this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:17:16: 17:22]`
27 LL | | "-" => |a, b| (a - b + cap) as i32,
28 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
29 LL | | _ => unimplemented!(),
31 | |_____- `match` arms have incompatible types
33 = note: expected closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:17:16: 17:22]`
34 found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:18:16: 18:22]`
35 = note: no two closures, even if identical, have the same type
36 = help: consider boxing your closure and/or using it as a trait object
38 error[E0308]: `match` arms have incompatible types
39 --> $DIR/closure_cap_coerce_many_fail.rs:27:16
41 LL | let _ = match "+" {
43 LL | | "+" => |a, b| (a + b + cap) as i32,
44 | | ---------------------------
46 | | the expected closure
47 | | this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:22]`
48 LL | | "-" => |a, b| (a - b) as i32,
49 | | ^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
50 LL | | _ => unimplemented!(),
52 | |_____- `match` arms have incompatible types
54 = note: expected closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:22]`
55 found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:27:16: 27:22]`
56 = note: no two closures, even if identical, have the same type
57 = help: consider boxing your closure and/or using it as a trait object
59 error[E0308]: `match` arms have incompatible types
60 --> $DIR/closure_cap_coerce_many_fail.rs:35:16
62 LL | let _ = match "+" {
64 LL | | "+" => |a, b| (a + b + cap) as i32,
65 | | ---------------------------
67 | | the expected closure
68 | | this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:22]`
69 LL | | "-" => |a, b| (a - b + cap) as i32,
70 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
71 LL | | _ => unimplemented!(),
73 | |_____- `match` arms have incompatible types
75 = note: expected closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:22]`
76 found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:35:16: 35:22]`
77 = note: no two closures, even if identical, have the same type
78 = help: consider boxing your closure and/or using it as a trait object
80 error: aborting due to 4 previous errors
82 For more information about this error, try `rustc --explain E0308`.