fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
4.2 KiB138 linesraw
1error[E0308]: mismatched types
2  --> $DIR/issue-69306.rs:5:28
3   |
4LL | impl<T> S0<T> {
5   |      - this type parameter
6LL |     const C: S0<u8> = Self(0);
7   |                       ---- ^ expected type parameter `T`, found integer
8   |                       |
9   |                       arguments to this function are incorrect
10   |
11   = note: expected type parameter `T`
12                        found type `{integer}`
13note: tuple struct defined here
14  --> $DIR/issue-69306.rs:3:8
15   |
16LL | struct S0<T>(T);
17   |        ^^
18
19error[E0308]: mismatched types
20  --> $DIR/issue-69306.rs:5:23
21   |
22LL | impl<T> S0<T> {
23   |      - this type parameter
24LL |     const C: S0<u8> = Self(0);
25   |                       ^^^^^^^ expected `S0<u8>`, found `S0<T>`
26   |
27   = note: expected struct `S0<u8>`
28              found struct `S0<T>`
29
30error[E0308]: mismatched types
31  --> $DIR/issue-69306.rs:10:14
32   |
33LL | impl<T> S0<T> {
34   |      - this type parameter
35...
36LL |         Self(0);
37   |         ---- ^ expected type parameter `T`, found integer
38   |         |
39   |         arguments to this function are incorrect
40   |
41   = note: expected type parameter `T`
42                        found type `{integer}`
43note: tuple struct defined here
44  --> $DIR/issue-69306.rs:3:8
45   |
46LL | struct S0<T>(T);
47   |        ^^
48
49error[E0308]: mismatched types
50  --> $DIR/issue-69306.rs:27:14
51   |
52LL | impl<T> Foo<T> for <S0<T> as Fun>::Out {
53   |      - this type parameter
54LL |     fn foo() {
55LL |         Self(0);
56   |         ---- ^ expected type parameter `T`, found integer
57   |         |
58   |         arguments to this function are incorrect
59   |
60   = note: expected type parameter `T`
61                        found type `{integer}`
62note: tuple struct defined here
63  --> $DIR/issue-69306.rs:3:8
64   |
65LL | struct S0<T>(T);
66   |        ^^
67
68error[E0308]: mismatched types
69  --> $DIR/issue-69306.rs:33:32
70   |
71LL | impl<T> S1<T, u8> {
72   |      - this type parameter
73LL |     const C: S1<u8, u8> = Self(0, 1);
74   |                           ---- ^ expected type parameter `T`, found integer
75   |                           |
76   |                           arguments to this function are incorrect
77   |
78   = note: expected type parameter `T`
79                        found type `{integer}`
80note: tuple struct defined here
81  --> $DIR/issue-69306.rs:31:8
82   |
83LL | struct S1<T, U>(T, U);
84   |        ^^
85
86error[E0308]: mismatched types
87  --> $DIR/issue-69306.rs:33:27
88   |
89LL | impl<T> S1<T, u8> {
90   |      - this type parameter
91LL |     const C: S1<u8, u8> = Self(0, 1);
92   |                           ^^^^^^^^^^ expected `S1<u8, u8>`, found `S1<T, u8>`
93   |
94   = note: expected struct `S1<u8, _>`
95              found struct `S1<T, _>`
96
97error[E0308]: mismatched types
98  --> $DIR/issue-69306.rs:41:14
99   |
100LL | impl<T> S2<T> {
101   |      - expected type parameter
102LL |     fn map<U>(x: U) -> S2<U> {
103   |            - found type parameter
104LL |         Self(x)
105   |         ---- ^ expected type parameter `T`, found type parameter `U`
106   |         |
107   |         arguments to this function are incorrect
108   |
109   = note: expected type parameter `T`
110              found type parameter `U`
111   = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
112   = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
113note: tuple struct defined here
114  --> $DIR/issue-69306.rs:38:8
115   |
116LL | struct S2<T>(T);
117   |        ^^
118
119error[E0308]: mismatched types
120  --> $DIR/issue-69306.rs:41:9
121   |
122LL | impl<T> S2<T> {
123   |      - found type parameter
124LL |     fn map<U>(x: U) -> S2<U> {
125   |            -           ----- expected `S2<U>` because of return type
126   |            |
127   |            expected type parameter
128LL |         Self(x)
129   |         ^^^^^^^ expected `S2<U>`, found `S2<T>`
130   |
131   = note: expected struct `S2<U>`
132              found struct `S2<T>`
133   = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
134   = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
135
136error: aborting due to 8 previous errors
137
138For more information about this error, try `rustc --explain E0308`.