2020-09-02 07:40:56 +00:00
|
|
|
error[E0369]: binary operation `==` cannot be applied to type `fn() {f}`
|
2019-03-27 17:13:09 +00:00
|
|
|
--> $DIR/fn-compare-mismatch.rs:4:15
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let x = f == g;
|
2020-09-02 07:40:56 +00:00
|
|
|
| - ^^ - fn() {g}
|
2019-04-11 15:00:27 +00:00
|
|
|
| |
|
2020-09-02 07:40:56 +00:00
|
|
|
| fn() {f}
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2022-08-28 01:08:24 +00:00
|
|
|
help: use parentheses to call these
|
2019-04-12 13:59:30 +00:00
|
|
|
|
|
2022-08-28 01:08:24 +00:00
|
|
|
LL | let x = f() == g();
|
|
|
|
| ++ ++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/fn-compare-mismatch.rs:4:18
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let x = f == g;
|
|
|
|
| ^ expected fn item, found a different fn item
|
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= note: expected fn item `fn() {f}`
|
|
|
|
found fn item `fn() {g}`
|
2022-12-11 07:49:07 +00:00
|
|
|
= note: different fn items have unique types, even if their signatures are the same
|
2023-01-25 17:10:26 +00:00
|
|
|
= help: consider casting both fn items to fn pointers using `as fn()`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
2019-04-17 17:26:38 +00:00
|
|
|
Some errors have detailed explanations: E0308, E0369.
|
2018-08-08 12:28:26 +00:00
|
|
|
For more information about an error, try `rustc --explain E0308`.
|