fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.7 KiB82 linesraw
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 fn item `fn(i32, i32) -> i32 {add}`
15              found closure `{closure@$DIR/closure_cap_coerce_many_fail.rs:9:16: 9:22}`
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   | |                ---------------------
24   | |                |
25   | |                the expected closure
26   | |                this is found to be of type `{closure@$DIR/closure_cap_coerce_many_fail.rs:17:16: 17:22}`
27LL | |         "-" => |a, b| (a - b + cap) as i32,
28   | |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
29LL | |         _ => unimplemented!(),
30LL | |     };
31   | |_____- `match` arms have incompatible types
32   |
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
37
38error[E0308]: `match` arms have incompatible types
39  --> $DIR/closure_cap_coerce_many_fail.rs:27:16
40   |
41LL |       let _ = match "+" {
42   |  _____________-
43LL | |         "+" => |a, b| (a + b + cap) as i32,
44   | |                ---------------------------
45   | |                |
46   | |                the expected closure
47   | |                this is found to be of type `{closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:22}`
48LL | |         "-" => |a, b| (a - b) as i32,
49   | |                ^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
50LL | |         _ => unimplemented!(),
51LL | |     };
52   | |_____- `match` arms have incompatible types
53   |
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
58
59error[E0308]: `match` arms have incompatible types
60  --> $DIR/closure_cap_coerce_many_fail.rs:35:16
61   |
62LL |       let _ = match "+" {
63   |  _____________-
64LL | |         "+" => |a, b| (a + b + cap) as i32,
65   | |                ---------------------------
66   | |                |
67   | |                the expected closure
68   | |                this is found to be of type `{closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:22}`
69LL | |         "-" => |a, b| (a - b + cap) as i32,
70   | |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
71LL | |         _ => unimplemented!(),
72LL | |     };
73   | |_____- `match` arms have incompatible types
74   |
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
79
80error: aborting due to 4 previous errors
81
82For more information about this error, try `rustc --explain E0308`.