fork/rust

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

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

master
2.2 KiB79 linesraw
1error[E0369]: binary operation `==` cannot be applied to type `fn() {second}`
2  --> $DIR/issue-66667-function-cmp-cycle.rs:2:12
3   |
4LL |     second == 1
5   |     ------ ^^ - {integer}
6   |     |
7   |     fn() {second}
8
9error[E0308]: mismatched types
10  --> $DIR/issue-66667-function-cmp-cycle.rs:2:15
11   |
12LL |     second == 1
13   |               ^ expected fn item, found integer
14   |
15   = note: expected fn item `fn() {second}`
16                 found type `{integer}`
17
18error[E0308]: mismatched types
19  --> $DIR/issue-66667-function-cmp-cycle.rs:2:5
20   |
21LL | fn first() {
22   |           - help: try adding a return type: `-> bool`
23LL |     second == 1
24   |     ^^^^^^^^^^^ expected `()`, found `bool`
25
26error[E0369]: binary operation `==` cannot be applied to type `fn() {first}`
27  --> $DIR/issue-66667-function-cmp-cycle.rs:8:11
28   |
29LL |     first == 1
30   |     ----- ^^ - {integer}
31   |     |
32   |     fn() {first}
33
34error[E0308]: mismatched types
35  --> $DIR/issue-66667-function-cmp-cycle.rs:8:14
36   |
37LL |     first == 1
38   |              ^ expected fn item, found integer
39   |
40   = note: expected fn item `fn() {first}`
41                 found type `{integer}`
42
43error[E0308]: mismatched types
44  --> $DIR/issue-66667-function-cmp-cycle.rs:8:5
45   |
46LL | fn second() {
47   |            - help: try adding a return type: `-> bool`
48LL |     first == 1
49   |     ^^^^^^^^^^ expected `()`, found `bool`
50
51error[E0369]: binary operation `==` cannot be applied to type `fn() {bar}`
52  --> $DIR/issue-66667-function-cmp-cycle.rs:14:9
53   |
54LL |     bar == 1
55   |     --- ^^ - {integer}
56   |     |
57   |     fn() {bar}
58
59error[E0308]: mismatched types
60  --> $DIR/issue-66667-function-cmp-cycle.rs:14:12
61   |
62LL |     bar == 1
63   |            ^ expected fn item, found integer
64   |
65   = note: expected fn item `fn() {bar}`
66                 found type `{integer}`
67
68error[E0308]: mismatched types
69  --> $DIR/issue-66667-function-cmp-cycle.rs:14:5
70   |
71LL | fn bar() {
72   |         - help: try adding a return type: `-> bool`
73LL |     bar == 1
74   |     ^^^^^^^^ expected `()`, found `bool`
75
76error: aborting due to 9 previous errors
77
78Some errors have detailed explanations: E0308, E0369.
79For more information about an error, try `rustc --explain E0308`.