]> git.lizzy.rs Git - rust.git/blob - tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr
Rollup merge of #106889 - scottmcm:windows-mut, r=cuviper
[rust.git] / tests / ui / ufcs / ufcs-qpath-self-mismatch.stderr
1 error[E0277]: cannot add `u32` to `i32`
2   --> $DIR/ufcs-qpath-self-mismatch.rs:4:31
3    |
4 LL |     <i32 as Add<u32>>::add(1, 2);
5    |     ----------------------    ^ no implementation for `i32 + u32`
6    |     |
7    |     required by a bound introduced by this call
8    |
9    = help: the trait `Add<u32>` is not implemented for `i32`
10    = help: the following other types implement trait `Add<Rhs>`:
11              <&'a i32 as Add<i32>>
12              <&i32 as Add<&i32>>
13              <i32 as Add<&i32>>
14              <i32 as Add>
15
16 error[E0308]: mismatched types
17   --> $DIR/ufcs-qpath-self-mismatch.rs:7:28
18    |
19 LL |     <i32 as Add<i32>>::add(1u32, 2);
20    |     ---------------------- ^^^^ expected `i32`, found `u32`
21    |     |
22    |     arguments to this function are incorrect
23    |
24 help: the return type of this call is `u32` due to the type of the argument passed
25   --> $DIR/ufcs-qpath-self-mismatch.rs:7:5
26    |
27 LL |     <i32 as Add<i32>>::add(1u32, 2);
28    |     ^^^^^^^^^^^^^^^^^^^^^^^----^^^^
29    |                            |
30    |                            this argument influences the return type of `Add`
31 note: associated function defined here
32   --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
33 help: change the type of the numeric literal from `u32` to `i32`
34    |
35 LL |     <i32 as Add<i32>>::add(1i32, 2);
36    |                             ~~~
37
38 error[E0308]: mismatched types
39   --> $DIR/ufcs-qpath-self-mismatch.rs:9:31
40    |
41 LL |     <i32 as Add<i32>>::add(1, 2u32);
42    |     ----------------------    ^^^^ expected `i32`, found `u32`
43    |     |
44    |     arguments to this function are incorrect
45    |
46 help: the return type of this call is `u32` due to the type of the argument passed
47   --> $DIR/ufcs-qpath-self-mismatch.rs:9:5
48    |
49 LL |     <i32 as Add<i32>>::add(1, 2u32);
50    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^----^
51    |                               |
52    |                               this argument influences the return type of `Add`
53 note: associated function defined here
54   --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
55 help: change the type of the numeric literal from `u32` to `i32`
56    |
57 LL |     <i32 as Add<i32>>::add(1, 2i32);
58    |                                ~~~
59
60 error[E0277]: cannot add `u32` to `i32`
61   --> $DIR/ufcs-qpath-self-mismatch.rs:4:5
62    |
63 LL |     <i32 as Add<u32>>::add(1, 2);
64    |     ^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32`
65    |
66    = help: the trait `Add<u32>` is not implemented for `i32`
67    = help: the following other types implement trait `Add<Rhs>`:
68              <&'a i32 as Add<i32>>
69              <&i32 as Add<&i32>>
70              <i32 as Add<&i32>>
71              <i32 as Add>
72
73 error: aborting due to 4 previous errors
74
75 Some errors have detailed explanations: E0277, E0308.
76 For more information about an error, try `rustc --explain E0277`.