1error[E0308]: `match` arms have incompatible types
2  --> $DIR/closure_cap_coerce_many_fail.rs:9:16
3   |
4LL |       let _ = match "+" {
5   |  _____________-
6LL | |         "+" => add,
7   | |                --- this is found to be of type `fn(i32, i32) -> i32 {add}`
8LL | |         "-" => |a, b| (a - b + cap) as i32,
9   | |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found closure
10LL | |         _ => unimplemented!(),
11LL | |     };
12   | |_____- `match` arms have incompatible types
13   |
14   = note: expected type `fn(i32, i32) -> i32 {add}`
15           found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:9:16: 9:43]`
16
17error[E0308]: `match` arms have incompatible types
18  --> $DIR/closure_cap_coerce_many_fail.rs:18:16
19   |
20LL |       let _ = match "+" {
21   |  _____________-
22LL | |         "+" => |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]`
24LL | |         "-" => |a, b| (a - b + cap) as i32,
25   | |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
26LL | |         _ => unimplemented!(),
27LL | |     };
28   | |_____- `match` arms have incompatible types
29   |
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
34
35error[E0308]: `match` arms have incompatible types
36  --> $DIR/closure_cap_coerce_many_fail.rs:27:16
37   |
38LL |       let _ = match "+" {
39   |  _____________-
40LL | |         "+" => |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]`
42LL | |         "-" => |a, b| (a - b) as i32,
43   | |                ^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
44LL | |         _ => unimplemented!(),
45LL | |     };
46   | |_____- `match` arms have incompatible types
47   |
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
52
53error[E0308]: `match` arms have incompatible types
54  --> $DIR/closure_cap_coerce_many_fail.rs:35:16
55   |
56LL |       let _ = match "+" {
57   |  _____________-
58LL | |         "+" => |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]`
60LL | |         "-" => |a, b| (a - b + cap) as i32,
61   | |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
62LL | |         _ => unimplemented!(),
63LL | |     };
64   | |_____- `match` arms have incompatible types
65   |
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
70
71error: aborting due to 4 previous errors
72
73For more information about this error, try `rustc --explain E0308`.
74