@@ -57,6 +57,19 @@ LL | type J = ty!(u8);
5757 |
5858 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
5959
60+ error[E0658]: unions with non-`Copy` fields are unstable
61+ --> $DIR/bad-assoc-ty.rs:69:1
62+ |
63+ LL | / union O<F> where F: Fn() -> _ {
64+ LL | |
65+ LL | |
66+ LL | | foo: F,
67+ LL | | }
68+ | |_^
69+ |
70+ = note: see issue #55149 <https://github.com/rust-lang/rust/issues/55149> for more information
71+ = help: add `#![feature(untagged_unions)]` to the crate attributes to enable
72+
6073error[E0223]: ambiguous associated type
6174 --> $DIR/bad-assoc-ty.rs:1:10
6275 |
@@ -129,8 +142,101 @@ LL | fn foo<X: K<_, _>>(x: X) {}
129142 | ^ ^ not allowed in type signatures
130143 | |
131144 | not allowed in type signatures
145+ |
146+ help: use type parameters instead
147+ |
148+ LL | fn foo<X, T: K<T, T>>(x: X) {}
149+ | ^^^ ^ ^
150+
151+ error[E0121]: the type placeholder `_` is not allowed within types on item signatures
152+ --> $DIR/bad-assoc-ty.rs:52:34
153+ |
154+ LL | fn bar<F>(_: F) where F: Fn() -> _ {}
155+ | ^ not allowed in type signatures
156+ |
157+ help: use type parameters instead
158+ |
159+ LL | fn bar<F, T>(_: F) where F: Fn() -> T {}
160+ | ^^^ ^
161+
162+ error[E0121]: the type placeholder `_` is not allowed within types on item signatures
163+ --> $DIR/bad-assoc-ty.rs:55:19
164+ |
165+ LL | fn baz<F: Fn() -> _>(_: F) {}
166+ | ^ not allowed in type signatures
167+ |
168+ help: use type parameters instead
169+ |
170+ LL | fn baz<F, T: Fn() -> T>(_: F) {}
171+ | ^^^ ^
172+
173+ error[E0121]: the type placeholder `_` is not allowed within types on item signatures
174+ --> $DIR/bad-assoc-ty.rs:58:33
175+ |
176+ LL | struct L<F>(F) where F: Fn() -> _;
177+ | ^ not allowed in type signatures
178+ |
179+ help: use type parameters instead
180+ |
181+ LL | struct L<F, T>(F) where F: Fn() -> T;
182+ | ^^^ ^
183+
184+ error[E0121]: the type placeholder `_` is not allowed within types on item signatures
185+ --> $DIR/bad-assoc-ty.rs:60:30
186+ |
187+ LL | struct M<F> where F: Fn() -> _ {
188+ | ^ not allowed in type signatures
189+ |
190+ help: use type parameters instead
191+ |
192+ LL | struct M<F, T> where F: Fn() -> T {
193+ | ^^^ ^
194+
195+ error[E0121]: the type placeholder `_` is not allowed within types on item signatures
196+ --> $DIR/bad-assoc-ty.rs:64:28
197+ |
198+ LL | enum N<F> where F: Fn() -> _ {
199+ | ^ not allowed in type signatures
200+ |
201+ help: use type parameters instead
202+ |
203+ LL | enum N<F, T> where F: Fn() -> T {
204+ | ^^^ ^
205+
206+ error[E0121]: the type placeholder `_` is not allowed within types on item signatures
207+ --> $DIR/bad-assoc-ty.rs:69:29
208+ |
209+ LL | union O<F> where F: Fn() -> _ {
210+ | ^ not allowed in type signatures
211+ |
212+ help: use type parameters instead
213+ |
214+ LL | union O<F, T> where F: Fn() -> T {
215+ | ^^^ ^
216+
217+ error[E0121]: the type placeholder `_` is not allowed within types on item signatures
218+ --> $DIR/bad-assoc-ty.rs:75:29
219+ |
220+ LL | trait P<F> where F: Fn() -> _ {
221+ | ^ not allowed in type signatures
222+ |
223+ help: use type parameters instead
224+ |
225+ LL | trait P<F, T> where F: Fn() -> T {
226+ | ^^^ ^
227+
228+ error[E0121]: the type placeholder `_` is not allowed within types on item signatures
229+ --> $DIR/bad-assoc-ty.rs:80:38
230+ |
231+ LL | fn foo<F>(_: F) where F: Fn() -> _ {}
232+ | ^ not allowed in type signatures
233+ |
234+ help: use type parameters instead
235+ |
236+ LL | fn foo<F, T>(_: F) where F: Fn() -> T {}
237+ | ^^^ ^
132238
133- error: aborting due to 20 previous errors
239+ error: aborting due to 29 previous errors
134240
135- Some errors have detailed explanations: E0121, E0223.
241+ Some errors have detailed explanations: E0121, E0223, E0658 .
136242For more information about an error, try `rustc --explain E0121`.
0 commit comments