]> git.lizzy.rs Git - rust.git/blob - tests/ui/fn/fn-compare-mismatch.stderr
Rollup merge of #107022 - scottmcm:ordering-option-eq, r=m-ou-se
[rust.git] / tests / ui / fn / fn-compare-mismatch.stderr
1 error[E0369]: binary operation `==` cannot be applied to type `fn() {f}`
2   --> $DIR/fn-compare-mismatch.rs:4:15
3    |
4 LL |     let x = f == g;
5    |             - ^^ - fn() {g}
6    |             |
7    |             fn() {f}
8    |
9 help: use parentheses to call these
10    |
11 LL |     let x = f() == g();
12    |              ++     ++
13
14 error[E0308]: mismatched types
15   --> $DIR/fn-compare-mismatch.rs:4:18
16    |
17 LL |     let x = f == g;
18    |                  ^ expected fn item, found a different fn item
19    |
20    = note: expected fn item `fn() {f}`
21               found fn item `fn() {g}`
22    = note: different fn items have unique types, even if their signatures are the same
23    = help: consider casting both fn items to fn pointers using `as fn()`
24
25 error: aborting due to 2 previous errors
26
27 Some errors have detailed explanations: E0308, E0369.
28 For more information about an error, try `rustc --explain E0308`.