]>
Commit | Line | Data |
---|---|---|
94222f64 XL |
1 | error[E0271]: type mismatch resolving `<A as Trait>::Associated == ()` |
2 | --> $DIR/issue-87261.rs:56:5 | |
3 | | | |
4 | LL | accepts_trait(a); | |
5 | | ^^^^^^^^^^^^^ expected `()`, found associated type | |
6 | | | |
7 | = note: expected unit type `()` | |
8 | found associated type `<A as Trait>::Associated` | |
9 | note: required by a bound in `accepts_trait` | |
10 | --> $DIR/issue-87261.rs:43:27 | |
11 | | | |
12 | LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {} | |
13 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait` | |
14 | help: consider constraining the associated type `<A as Trait>::Associated` to `()` | |
15 | | | |
16 | LL | A: Trait<Associated = ()> + 'static, | |
17 | | +++++++++++++++++ | |
18 | ||
19 | error[E0271]: type mismatch resolving `<B as Trait>::Associated == ()` | |
20 | --> $DIR/issue-87261.rs:59:5 | |
21 | | | |
22 | LL | accepts_trait(b); | |
23 | | ^^^^^^^^^^^^^ expected `()`, found associated type | |
24 | | | |
25 | = note: expected unit type `()` | |
26 | found associated type `<B as Trait>::Associated` | |
27 | = help: consider constraining the associated type `<B as Trait>::Associated` to `()` | |
28 | = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html | |
29 | note: required by a bound in `accepts_trait` | |
30 | --> $DIR/issue-87261.rs:43:27 | |
31 | | | |
32 | LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {} | |
33 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait` | |
34 | ||
35 | error[E0271]: type mismatch resolving `<C as Trait>::Associated == ()` | |
36 | --> $DIR/issue-87261.rs:62:5 | |
37 | | | |
38 | LL | accepts_trait(c); | |
39 | | ^^^^^^^^^^^^^ expected `()`, found associated type | |
40 | | | |
41 | = note: expected unit type `()` | |
42 | found associated type `<C as Trait>::Associated` | |
43 | note: required by a bound in `accepts_trait` | |
44 | --> $DIR/issue-87261.rs:43:27 | |
45 | | | |
46 | LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {} | |
47 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait` | |
48 | help: consider constraining the associated type `<C as Trait>::Associated` to `()` | |
49 | | | |
50 | LL | C: Trait<Associated = ()> + Foo, | |
51 | | +++++++++++++++++ | |
52 | ||
53 | error[E0271]: type mismatch resolving `<D as Trait>::Associated == ()` | |
54 | --> $DIR/issue-87261.rs:65:5 | |
55 | | | |
56 | LL | accepts_trait(d); | |
57 | | ^^^^^^^^^^^^^ expected `()`, found associated type | |
58 | | | |
59 | = note: expected unit type `()` | |
60 | found associated type `<D as Trait>::Associated` | |
61 | = help: consider constraining the associated type `<D as Trait>::Associated` to `()` | |
62 | = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html | |
63 | note: required by a bound in `accepts_trait` | |
64 | --> $DIR/issue-87261.rs:43:27 | |
65 | | | |
66 | LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {} | |
67 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait` | |
68 | ||
69 | error[E0271]: type mismatch resolving `<E as GenericTrait<()>>::Associated == ()` | |
70 | --> $DIR/issue-87261.rs:68:5 | |
71 | | | |
72 | LL | accepts_generic_trait(e); | |
73 | | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type | |
74 | | | |
75 | = note: expected unit type `()` | |
76 | found associated type `<E as GenericTrait<()>>::Associated` | |
77 | note: required by a bound in `accepts_generic_trait` | |
78 | --> $DIR/issue-87261.rs:44:46 | |
79 | | | |
80 | LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {} | |
81 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait` | |
82 | help: consider constraining the associated type `<E as GenericTrait<()>>::Associated` to `()` | |
83 | | | |
84 | LL | E: GenericTrait<(), Associated = ()> + 'static, | |
85 | | +++++++++++++++++ | |
86 | ||
87 | error[E0271]: type mismatch resolving `<F as GenericTrait<()>>::Associated == ()` | |
88 | --> $DIR/issue-87261.rs:71:5 | |
89 | | | |
90 | LL | accepts_generic_trait(f); | |
91 | | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type | |
92 | | | |
93 | = note: expected unit type `()` | |
94 | found associated type `<F as GenericTrait<()>>::Associated` | |
95 | note: required by a bound in `accepts_generic_trait` | |
96 | --> $DIR/issue-87261.rs:44:46 | |
97 | | | |
98 | LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {} | |
99 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait` | |
100 | help: consider constraining the associated type `<F as GenericTrait<()>>::Associated` to `()` | |
101 | | | |
102 | LL | F: GenericTrait<(), Associated = ()> + Foo, | |
103 | | +++++++++++++++++ | |
104 | ||
105 | error[E0271]: type mismatch resolving `<G as GenericTrait<()>>::Associated == ()` | |
106 | --> $DIR/issue-87261.rs:74:5 | |
107 | | | |
108 | LL | accepts_generic_trait(g); | |
109 | | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type | |
110 | | | |
111 | = note: expected unit type `()` | |
112 | found associated type `<G as GenericTrait<()>>::Associated` | |
113 | = help: consider constraining the associated type `<G as GenericTrait<()>>::Associated` to `()` | |
114 | = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html | |
115 | note: required by a bound in `accepts_generic_trait` | |
116 | --> $DIR/issue-87261.rs:44:46 | |
117 | | | |
118 | LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {} | |
119 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait` | |
120 | ||
121 | error[E0271]: type mismatch resolving `<impl Trait as Trait>::Associated == ()` | |
122 | --> $DIR/issue-87261.rs:79:5 | |
123 | | | |
124 | LL | fn returns_opaque() -> impl Trait + 'static { | |
125 | | -------------------- the found opaque type | |
126 | ... | |
127 | LL | accepts_trait(returns_opaque()); | |
128 | | ^^^^^^^^^^^^^ expected `()`, found associated type | |
129 | | | |
130 | = note: expected unit type `()` | |
131 | found associated type `<impl Trait as Trait>::Associated` | |
132 | note: required by a bound in `accepts_trait` | |
133 | --> $DIR/issue-87261.rs:43:27 | |
134 | | | |
135 | LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {} | |
136 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait` | |
137 | help: consider constraining the associated type `<impl Trait as Trait>::Associated` to `()` | |
138 | | | |
139 | LL | fn returns_opaque() -> impl Trait<Associated = ()> + 'static { | |
140 | | +++++++++++++++++ | |
141 | ||
142 | error[E0271]: type mismatch resolving `<impl DerivedTrait as Trait>::Associated == ()` | |
143 | --> $DIR/issue-87261.rs:82:5 | |
144 | | | |
145 | LL | fn returns_opaque_derived() -> impl DerivedTrait + 'static { | |
146 | | --------------------------- the found opaque type | |
147 | ... | |
148 | LL | accepts_trait(returns_opaque_derived()); | |
149 | | ^^^^^^^^^^^^^ expected `()`, found associated type | |
150 | | | |
151 | = note: expected unit type `()` | |
152 | found associated type `<impl DerivedTrait as Trait>::Associated` | |
153 | note: required by a bound in `accepts_trait` | |
154 | --> $DIR/issue-87261.rs:43:27 | |
155 | | | |
156 | LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {} | |
157 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait` | |
158 | help: consider constraining the associated type `<impl DerivedTrait as Trait>::Associated` to `()` | |
159 | | | |
160 | LL | fn returns_opaque_derived() -> impl DerivedTrait<Associated = ()> + 'static { | |
161 | | +++++++++++++++++ | |
162 | ||
923072b8 | 163 | error[E0271]: type mismatch resolving `<impl Trait + Foo as Trait>::Associated == ()` |
94222f64 XL |
164 | --> $DIR/issue-87261.rs:85:5 |
165 | | | |
166 | LL | fn returns_opaque_foo() -> impl Trait + Foo { | |
167 | | ---------------- the found opaque type | |
168 | ... | |
169 | LL | accepts_trait(returns_opaque_foo()); | |
170 | | ^^^^^^^^^^^^^ expected `()`, found associated type | |
171 | | | |
172 | = note: expected unit type `()` | |
923072b8 | 173 | found associated type `<impl Trait + Foo as Trait>::Associated` |
94222f64 XL |
174 | note: required by a bound in `accepts_trait` |
175 | --> $DIR/issue-87261.rs:43:27 | |
176 | | | |
177 | LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {} | |
178 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait` | |
923072b8 | 179 | help: consider constraining the associated type `<impl Trait + Foo as Trait>::Associated` to `()` |
94222f64 XL |
180 | | |
181 | LL | fn returns_opaque_foo() -> impl Trait<Associated = ()> + Foo { | |
182 | | +++++++++++++++++ | |
183 | ||
923072b8 | 184 | error[E0271]: type mismatch resolving `<impl DerivedTrait + Foo as Trait>::Associated == ()` |
94222f64 XL |
185 | --> $DIR/issue-87261.rs:88:5 |
186 | | | |
187 | LL | fn returns_opaque_derived_foo() -> impl DerivedTrait + Foo { | |
188 | | ----------------------- the found opaque type | |
189 | ... | |
190 | LL | accepts_trait(returns_opaque_derived_foo()); | |
191 | | ^^^^^^^^^^^^^ expected `()`, found associated type | |
192 | | | |
193 | = note: expected unit type `()` | |
923072b8 FG |
194 | found associated type `<impl DerivedTrait + Foo as Trait>::Associated` |
195 | = help: consider constraining the associated type `<impl DerivedTrait + Foo as Trait>::Associated` to `()` | |
94222f64 XL |
196 | = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html |
197 | note: required by a bound in `accepts_trait` | |
198 | --> $DIR/issue-87261.rs:43:27 | |
199 | | | |
200 | LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {} | |
201 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait` | |
202 | ||
203 | error[E0271]: type mismatch resolving `<impl GenericTrait<()> as GenericTrait<()>>::Associated == ()` | |
204 | --> $DIR/issue-87261.rs:91:5 | |
205 | | | |
206 | LL | fn returns_opaque_generic() -> impl GenericTrait<()> + 'static { | |
207 | | ------------------------------- the found opaque type | |
208 | ... | |
209 | LL | accepts_generic_trait(returns_opaque_generic()); | |
210 | | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type | |
211 | | | |
212 | = note: expected unit type `()` | |
213 | found associated type `<impl GenericTrait<()> as GenericTrait<()>>::Associated` | |
214 | note: required by a bound in `accepts_generic_trait` | |
215 | --> $DIR/issue-87261.rs:44:46 | |
216 | | | |
217 | LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {} | |
218 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait` | |
219 | help: consider constraining the associated type `<impl GenericTrait<()> as GenericTrait<()>>::Associated` to `()` | |
220 | | | |
221 | LL | fn returns_opaque_generic() -> impl GenericTrait<(), Associated = ()> + 'static { | |
222 | | +++++++++++++++++ | |
223 | ||
923072b8 | 224 | error[E0271]: type mismatch resolving `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated == ()` |
94222f64 XL |
225 | --> $DIR/issue-87261.rs:94:5 |
226 | | | |
227 | LL | fn returns_opaque_generic_foo() -> impl GenericTrait<()> + Foo { | |
228 | | --------------------------- the found opaque type | |
229 | ... | |
230 | LL | accepts_generic_trait(returns_opaque_generic_foo()); | |
231 | | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type | |
232 | | | |
233 | = note: expected unit type `()` | |
923072b8 | 234 | found associated type `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated` |
94222f64 XL |
235 | note: required by a bound in `accepts_generic_trait` |
236 | --> $DIR/issue-87261.rs:44:46 | |
237 | | | |
238 | LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {} | |
239 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait` | |
923072b8 | 240 | help: consider constraining the associated type `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated` to `()` |
94222f64 XL |
241 | | |
242 | LL | fn returns_opaque_generic_foo() -> impl GenericTrait<(), Associated = ()> + Foo { | |
243 | | +++++++++++++++++ | |
244 | ||
923072b8 | 245 | error[E0271]: type mismatch resolving `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated == ()` |
94222f64 XL |
246 | --> $DIR/issue-87261.rs:97:5 |
247 | | | |
248 | LL | fn returns_opaque_generic_duplicate() -> impl GenericTrait<()> + GenericTrait<u8> { | |
249 | | ---------------------------------------- the found opaque type | |
250 | ... | |
251 | LL | accepts_generic_trait(returns_opaque_generic_duplicate()); | |
252 | | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type | |
253 | | | |
254 | = note: expected unit type `()` | |
923072b8 FG |
255 | found associated type `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated` |
256 | = help: consider constraining the associated type `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated` to `()` | |
94222f64 XL |
257 | = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html |
258 | note: required by a bound in `accepts_generic_trait` | |
259 | --> $DIR/issue-87261.rs:44:46 | |
260 | | | |
261 | LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {} | |
262 | | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait` | |
263 | ||
264 | error: aborting due to 14 previous errors | |
265 | ||
266 | For more information about this error, try `rustc --explain E0271`. |