]> git.lizzy.rs Git - rust.git/blob - src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
Rollup merge of #99479 - Enselic:import-can-be-without-id, r=camelid
[rust.git] / src / test / ui / ufcs / ufcs-qpath-self-mismatch.stderr
1 error[E0277]: cannot add `u32` to `i32`
2   --> $DIR/ufcs-qpath-self-mismatch.rs:4:5
3    |
4 LL |     <i32 as Add<u32>>::add(1, 2);
5    |     ^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32`
6    |
7    = help: the trait `Add<u32>` is not implemented for `i32`
8    = help: the following other types implement trait `Add<Rhs>`:
9              <&'a f32 as Add<f32>>
10              <&'a f64 as Add<f64>>
11              <&'a i128 as Add<i128>>
12              <&'a i16 as Add<i16>>
13              <&'a i32 as Add<i32>>
14              <&'a i64 as Add<i64>>
15              <&'a i8 as Add<i8>>
16              <&'a isize as Add<isize>>
17            and 48 others
18
19 error[E0308]: mismatched types
20   --> $DIR/ufcs-qpath-self-mismatch.rs:6:28
21    |
22 LL |     <i32 as Add<i32>>::add(1u32, 2);
23    |     ---------------------- ^^^^ expected `i32`, found `u32`
24    |     |
25    |     arguments to this function are incorrect
26    |
27 note: associated function defined here
28   --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
29    |
30 LL |     fn add(self, rhs: Rhs) -> Self::Output;
31    |        ^^^
32 help: change the type of the numeric literal from `u32` to `i32`
33    |
34 LL |     <i32 as Add<i32>>::add(1i32, 2);
35    |                             ~~~
36
37 error[E0308]: mismatched types
38   --> $DIR/ufcs-qpath-self-mismatch.rs:8:31
39    |
40 LL |     <i32 as Add<i32>>::add(1, 2u32);
41    |     ----------------------    ^^^^ expected `i32`, found `u32`
42    |     |
43    |     arguments to this function are incorrect
44    |
45 note: associated function defined here
46   --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
47    |
48 LL |     fn add(self, rhs: Rhs) -> Self::Output;
49    |        ^^^
50 help: change the type of the numeric literal from `u32` to `i32`
51    |
52 LL |     <i32 as Add<i32>>::add(1, 2i32);
53    |                                ~~~
54
55 error: aborting due to 3 previous errors
56
57 Some errors have detailed explanations: E0277, E0308.
58 For more information about an error, try `rustc --explain E0277`.