fork/rust

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

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

master
3.3 KiB107 linesraw
1error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}`
2  --> $DIR/issue-59488.rs:14:9
3   |
4LL |     foo > 12;
5   |     --- ^ -- {integer}
6   |     |
7   |     fn() -> i32 {foo}
8   |
9help: use parentheses to call this function
10   |
11LL |     foo() > 12;
12   |        ++
13
14error[E0308]: mismatched types
15  --> $DIR/issue-59488.rs:14:11
16   |
17LL |     foo > 12;
18   |           ^^ expected fn item, found `i32`
19   |
20   = note: expected fn item `fn() -> i32 {foo}`
21                 found type `i32`
22
23error[E0369]: binary operation `>` cannot be applied to type `fn(i64) -> i64 {bar}`
24  --> $DIR/issue-59488.rs:18:9
25   |
26LL |     bar > 13;
27   |     --- ^ -- {integer}
28   |     |
29   |     fn(i64) -> i64 {bar}
30   |
31help: use parentheses to call this function
32   |
33LL |     bar(/* i64 */) > 13;
34   |        +++++++++++
35
36error[E0308]: mismatched types
37  --> $DIR/issue-59488.rs:18:11
38   |
39LL |     bar > 13;
40   |           ^^ expected fn item, found `i64`
41   |
42   = note: expected fn item `fn(i64) -> i64 {bar}`
43                 found type `i64`
44
45error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}`
46  --> $DIR/issue-59488.rs:22:9
47   |
48LL |     foo > foo;
49   |     --- ^ --- fn() -> i32 {foo}
50   |     |
51   |     fn() -> i32 {foo}
52   |
53help: use parentheses to call these
54   |
55LL |     foo() > foo();
56   |        ++      ++
57
58error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}`
59  --> $DIR/issue-59488.rs:25:9
60   |
61LL |     foo > bar;
62   |     --- ^ --- fn(i64) -> i64 {bar}
63   |     |
64   |     fn() -> i32 {foo}
65
66error[E0308]: mismatched types
67  --> $DIR/issue-59488.rs:25:11
68   |
69LL |     foo > bar;
70   |           ^^^ expected fn item, found a different fn item
71   |
72   = note: expected fn item `fn() -> i32 {foo}`
73              found fn item `fn(i64) -> i64 {bar}`
74
75error[E0369]: binary operation `==` cannot be applied to type `fn(usize) -> Foo {Foo::Bar}`
76  --> $DIR/issue-59488.rs:30:5
77   |
78LL |     assert_eq!(Foo::Bar, i);
79   |     ^^^^^^^^^^^^^^^^^^^^^^^
80   |     |
81   |     fn(usize) -> Foo {Foo::Bar}
82   |     fn(usize) -> Foo {Foo::Bar}
83   |
84   = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
85
86error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug`
87  --> $DIR/issue-59488.rs:30:5
88   |
89LL |     assert_eq!(Foo::Bar, i);
90   |     ^^^^^^^^^^^^^^^^^^^^^^^ `fn(usize) -> Foo {Foo::Bar}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
91   |
92   = help: the trait `Debug` is not implemented for fn item `fn(usize) -> Foo {Foo::Bar}`
93   = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
94
95error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug`
96  --> $DIR/issue-59488.rs:30:5
97   |
98LL |     assert_eq!(Foo::Bar, i);
99   |     ^^^^^^^^^^^^^^^^^^^^^^^ `fn(usize) -> Foo {Foo::Bar}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
100   |
101   = help: the trait `Debug` is not implemented for fn item `fn(usize) -> Foo {Foo::Bar}`
102   = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
103
104error: aborting due to 10 previous errors
105
106Some errors have detailed explanations: E0277, E0308, E0369.
107For more information about an error, try `rustc --explain E0277`.