summaryrefslogtreecommitdiffstats
path: root/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
blob: eaab6ff3d9a0419227d6ad01307049dbebcc021a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
error[E0277]: cannot add `u32` to `i32`
  --> $DIR/ufcs-qpath-self-mismatch.rs:4:31
   |
LL |     <i32 as Add<u32>>::add(1, 2);
   |     ----------------------    ^ no implementation for `i32 + u32`
   |     |
   |     required by a bound introduced by this call
   |
   = help: the trait `Add<u32>` is not implemented for `i32`
   = help: the following other types implement trait `Add<Rhs>`:
             <&'a f32 as Add<f32>>
             <&'a f64 as Add<f64>>
             <&'a i128 as Add<i128>>
             <&'a i16 as Add<i16>>
             <&'a i32 as Add<i32>>
             <&'a i64 as Add<i64>>
             <&'a i8 as Add<i8>>
             <&'a isize as Add<isize>>
           and 48 others

error[E0308]: mismatched types
  --> $DIR/ufcs-qpath-self-mismatch.rs:7:28
   |
LL |     <i32 as Add<i32>>::add(1u32, 2);
   |     ---------------------- ^^^^ expected `i32`, found `u32`
   |     |
   |     arguments to this function are incorrect
   |
note: associated function defined here
  --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
   |
LL |     fn add(self, rhs: Rhs) -> Self::Output;
   |        ^^^
help: change the type of the numeric literal from `u32` to `i32`
   |
LL |     <i32 as Add<i32>>::add(1i32, 2);
   |                             ~~~

error[E0308]: mismatched types
  --> $DIR/ufcs-qpath-self-mismatch.rs:9:31
   |
LL |     <i32 as Add<i32>>::add(1, 2u32);
   |     ----------------------    ^^^^ expected `i32`, found `u32`
   |     |
   |     arguments to this function are incorrect
   |
note: associated function defined here
  --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
   |
LL |     fn add(self, rhs: Rhs) -> Self::Output;
   |        ^^^
help: change the type of the numeric literal from `u32` to `i32`
   |
LL |     <i32 as Add<i32>>::add(1, 2i32);
   |                                ~~~

error[E0277]: cannot add `u32` to `i32`
  --> $DIR/ufcs-qpath-self-mismatch.rs:4:5
   |
LL |     <i32 as Add<u32>>::add(1, 2);
   |     ^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32`
   |
   = help: the trait `Add<u32>` is not implemented for `i32`
   = help: the following other types implement trait `Add<Rhs>`:
             <&'a f32 as Add<f32>>
             <&'a f64 as Add<f64>>
             <&'a i128 as Add<i128>>
             <&'a i16 as Add<i16>>
             <&'a i32 as Add<i32>>
             <&'a i64 as Add<i64>>
             <&'a i8 as Add<i8>>
             <&'a isize as Add<isize>>
           and 48 others

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.