]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-59488.rs
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
[rust.git] / src / test / ui / issues / issue-59488.rs
1 fn foo() -> i32 {
2     42
3 }
4
5 fn bar(a: i64) -> i64 {
6     43
7 }
8
9 enum Foo {
10     Bar(usize),
11 }
12
13 fn main() {
14     foo > 12;
15     //~^ ERROR binary operation `>` cannot be applied to type `fn() -> i32 {foo}` [E0369]
16     //~| ERROR mismatched types [E0308]
17
18     bar > 13;
19     //~^ ERROR binary operation `>` cannot be applied to type `fn(i64) -> i64 {bar}` [E0369]
20     //~| ERROR mismatched types [E0308]
21
22     foo > foo;
23     //~^ ERROR binary operation `>` cannot be applied to type `fn() -> i32 {foo}` [E0369]
24
25     foo > bar;
26     //~^ ERROR binary operation `>` cannot be applied to type `fn() -> i32 {foo}` [E0369]
27     //~| ERROR mismatched types [E0308]
28
29     let i = Foo::Bar;
30     assert_eq!(Foo::Bar, i);
31     //~^ ERROR binary operation `==` cannot be applied to type `fn(usize) -> Foo {Foo::Bar}` [E0369]
32     //~| ERROR `fn(usize) -> Foo {Foo::Bar}` doesn't implement `std::fmt::Debug` [E0277]
33     //~| ERROR `fn(usize) -> Foo {Foo::Bar}` doesn't implement `std::fmt::Debug` [E0277]
34 }