fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

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