2022-12-17 14:11:29 -06:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/assoc-ct-for-assoc-method.rs:11:18
|
|
|
|
|
|
|
|
|
LL | let x: i32 = MyS::foo;
|
|
|
|
| --- ^^^^^^^^ expected `i32`, found fn item
|
|
|
|
| |
|
|
|
|
| expected due to this
|
|
|
|
|
|
|
|
|
= note: expected type `i32`
|
|
|
|
found fn item `fn() -> MyS {MyS::foo}`
|
2024-02-14 13:18:28 -06:00
|
|
|
help: try referring to the associated const `FOO` instead (notice the capitalization difference)
|
2022-12-17 14:11:29 -06:00
|
|
|
|
|
|
|
|
LL | let x: i32 = MyS::FOO;
|
|
|
|
| ~~~
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/assoc-ct-for-assoc-method.rs:15:18
|
|
|
|
|
|
|
|
|
LL | let z: i32 = i32::max;
|
|
|
|
| --- ^^^^^^^^ expected `i32`, found fn item
|
|
|
|
| |
|
|
|
|
| expected due to this
|
|
|
|
|
|
|
|
|
= note: expected type `i32`
|
|
|
|
found fn item `fn(i32, i32) -> i32 {<i32 as Ord>::max}`
|
|
|
|
help: try referring to the associated const `MAX` instead
|
|
|
|
|
|
|
|
|
LL | let z: i32 = i32::MAX;
|
|
|
|
| ~~~
|
|
|
|
|
|
|
|
error[E0369]: cannot subtract `{integer}` from `fn(i32, i32) -> i32 {<i32 as Ord>::max}`
|
|
|
|
--> $DIR/assoc-ct-for-assoc-method.rs:22:27
|
|
|
|
|
|
|
|
|
LL | let y: i32 = i32::max - 42;
|
|
|
|
| -------- ^ -- {integer}
|
|
|
|
| |
|
|
|
|
| fn(i32, i32) -> i32 {<i32 as Ord>::max}
|
|
|
|
|
|
2023-02-21 15:11:08 -06:00
|
|
|
help: use parentheses to call this method
|
2022-12-17 14:11:29 -06:00
|
|
|
|
|
|
|
|
LL | let y: i32 = i32::max(/* i32 */, /* i32 */) - 42;
|
|
|
|
| ++++++++++++++++++++++
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
Some errors have detailed explanations: E0308, E0369.
|
|
|
|
For more information about an error, try `rustc --explain E0308`.
|