]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/assoc-ct-for-assoc-method.stderr
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / assoc-ct-for-assoc-method.stderr
1 error[E0308]: mismatched types
2   --> $DIR/assoc-ct-for-assoc-method.rs:11:18
3    |
4 LL |     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}`
11 help: try referring to the associated const `FOO` instead
12    |
13 LL |     let x: i32 = MyS::FOO;
14    |                       ~~~
15
16 error[E0308]: mismatched types
17   --> $DIR/assoc-ct-for-assoc-method.rs:15:18
18    |
19 LL |     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}`
26 help: try referring to the associated const `MAX` instead
27    |
28 LL |     let z: i32 = i32::MAX;
29    |                       ~~~
30
31 error[E0369]: cannot subtract `{integer}` from `fn(i32, i32) -> i32 {<i32 as Ord>::max}`
32   --> $DIR/assoc-ct-for-assoc-method.rs:22:27
33    |
34 LL |     let y: i32 = i32::max - 42;
35    |                  -------- ^ -- {integer}
36    |                  |
37    |                  fn(i32, i32) -> i32 {<i32 as Ord>::max}
38    |
39 help: use parentheses to call this associated function
40    |
41 LL |     let y: i32 = i32::max(/* i32 */, /* i32 */) - 42;
42    |                          ++++++++++++++++++++++
43
44 error: aborting due to 3 previous errors
45
46 Some errors have detailed explanations: E0308, E0369.
47 For more information about an error, try `rustc --explain E0308`.