fork/rust

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

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

master
1.5 KiB47 linesraw
1error[E0308]: mismatched types
2  --> $DIR/assoc-ct-for-assoc-method.rs:11:18
3   |
4LL |     let x: i32 = MyS::foo;
5   |            ---   ^^^^^^^^ expected `i32`, found fn item
6   |            |
7   |            expected due to this
8   |
9   = note: expected type `i32`
10           found fn item `fn() -> MyS {MyS::foo}`
11help: try referring to the associated const `FOO` instead
12   |
13LL |     let x: i32 = MyS::FOO;
14   |                       ~~~
15
16error[E0308]: mismatched types
17  --> $DIR/assoc-ct-for-assoc-method.rs:15:18
18   |
19LL |     let z: i32 = i32::max;
20   |            ---   ^^^^^^^^ expected `i32`, found fn item
21   |            |
22   |            expected due to this
23   |
24   = note: expected type `i32`
25           found fn item `fn(i32, i32) -> i32 {<i32 as Ord>::max}`
26help: try referring to the associated const `MAX` instead
27   |
28LL |     let z: i32 = i32::MAX;
29   |                       ~~~
30
31error[E0369]: cannot subtract `{integer}` from `fn(i32, i32) -> i32 {<i32 as Ord>::max}`
32  --> $DIR/assoc-ct-for-assoc-method.rs:22:27
33   |
34LL |     let y: i32 = i32::max - 42;
35   |                  -------- ^ -- {integer}
36   |                  |
37   |                  fn(i32, i32) -> i32 {<i32 as Ord>::max}
38   |
39help: use parentheses to call this method
40   |
41LL |     let y: i32 = i32::max(/* i32 */, /* i32 */) - 42;
42   |                          ++++++++++++++++++++++
43
44error: aborting due to 3 previous errors
45
46Some errors have detailed explanations: E0308, E0369.
47For more information about an error, try `rustc --explain E0308`.