]> git.lizzy.rs Git - rust.git/blob - src/test/ui/did_you_mean/bad-assoc-ty.stderr
Rollup merge of #101388 - compiler-errors:issue-101376, r=fee1-dead
[rust.git] / src / test / ui / did_you_mean / bad-assoc-ty.stderr
1 error: missing angle brackets in associated item path
2   --> $DIR/bad-assoc-ty.rs:1:10
3    |
4 LL | type A = [u8; 4]::AssocTy;
5    |          ^^^^^^^^^^^^^^^^ help: try: `<[u8; 4]>::AssocTy`
6
7 error: missing angle brackets in associated item path
8   --> $DIR/bad-assoc-ty.rs:5:10
9    |
10 LL | type B = [u8]::AssocTy;
11    |          ^^^^^^^^^^^^^ help: try: `<[u8]>::AssocTy`
12
13 error: missing angle brackets in associated item path
14   --> $DIR/bad-assoc-ty.rs:9:10
15    |
16 LL | type C = (u8)::AssocTy;
17    |          ^^^^^^^^^^^^^ help: try: `<(u8)>::AssocTy`
18
19 error: missing angle brackets in associated item path
20   --> $DIR/bad-assoc-ty.rs:13:10
21    |
22 LL | type D = (u8, u8)::AssocTy;
23    |          ^^^^^^^^^^^^^^^^^ help: try: `<(u8, u8)>::AssocTy`
24
25 error: missing angle brackets in associated item path
26   --> $DIR/bad-assoc-ty.rs:17:10
27    |
28 LL | type E = _::AssocTy;
29    |          ^^^^^^^^^^ help: try: `<_>::AssocTy`
30
31 error: missing angle brackets in associated item path
32   --> $DIR/bad-assoc-ty.rs:21:19
33    |
34 LL | type F = &'static (u8)::AssocTy;
35    |                   ^^^^^^^^^^^^^ help: try: `<(u8)>::AssocTy`
36
37 error: missing angle brackets in associated item path
38   --> $DIR/bad-assoc-ty.rs:27:10
39    |
40 LL | type G = dyn 'static + (Send)::AssocTy;
41    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `<dyn 'static + (Send)>::AssocTy`
42
43 error: missing angle brackets in associated item path
44   --> $DIR/bad-assoc-ty.rs:46:10
45    |
46 LL | type I = ty!()::AssocTy;
47    |          ^^^^^^^^^^^^^^ help: try: `<ty!()>::AssocTy`
48
49 error: missing angle brackets in associated item path
50   --> $DIR/bad-assoc-ty.rs:39:19
51    |
52 LL |     ($ty: ty) => ($ty::AssocTy);
53    |                   ^^^^^^^^^^^^ help: try: `<$ty>::AssocTy`
54 ...
55 LL | type J = ty!(u8);
56    |          ------- in this macro invocation
57    |
58    = note: this error originates in the macro `ty` (in Nightly builds, run with -Z macro-backtrace for more info)
59
60 error[E0223]: ambiguous associated type
61   --> $DIR/bad-assoc-ty.rs:1:10
62    |
63 LL | type A = [u8; 4]::AssocTy;
64    |          ^^^^^^^^^^^^^^^^ help: use fully-qualified syntax: `<[u8; 4] as Trait>::AssocTy`
65
66 error[E0223]: ambiguous associated type
67   --> $DIR/bad-assoc-ty.rs:5:10
68    |
69 LL | type B = [u8]::AssocTy;
70    |          ^^^^^^^^^^^^^ help: use fully-qualified syntax: `<[u8] as Trait>::AssocTy`
71
72 error[E0223]: ambiguous associated type
73   --> $DIR/bad-assoc-ty.rs:9:10
74    |
75 LL | type C = (u8)::AssocTy;
76    |          ^^^^^^^^^^^^^ help: use fully-qualified syntax: `<u8 as Trait>::AssocTy`
77
78 error[E0223]: ambiguous associated type
79   --> $DIR/bad-assoc-ty.rs:13:10
80    |
81 LL | type D = (u8, u8)::AssocTy;
82    |          ^^^^^^^^^^^^^^^^^ help: use fully-qualified syntax: `<(u8, u8) as Trait>::AssocTy`
83
84 error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases
85   --> $DIR/bad-assoc-ty.rs:17:10
86    |
87 LL | type E = _::AssocTy;
88    |          ^ not allowed in type signatures
89
90 error[E0223]: ambiguous associated type
91   --> $DIR/bad-assoc-ty.rs:21:19
92    |
93 LL | type F = &'static (u8)::AssocTy;
94    |                   ^^^^^^^^^^^^^ help: use fully-qualified syntax: `<u8 as Trait>::AssocTy`
95
96 error[E0223]: ambiguous associated type
97   --> $DIR/bad-assoc-ty.rs:27:10
98    |
99 LL | type G = dyn 'static + (Send)::AssocTy;
100    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use fully-qualified syntax: `<(dyn Send + 'static) as Trait>::AssocTy`
101
102 warning: trait objects without an explicit `dyn` are deprecated
103   --> $DIR/bad-assoc-ty.rs:33:10
104    |
105 LL | type H = Fn(u8) -> (u8)::Output;
106    |          ^^^^^^^^^^^^^^
107    |
108    = note: `#[warn(bare_trait_objects)]` on by default
109    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
110    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
111 help: use `dyn`
112    |
113 LL | type H = <dyn Fn(u8) -> (u8)>::Output;
114    |          ++++               +
115
116 error[E0223]: ambiguous associated type
117   --> $DIR/bad-assoc-ty.rs:33:10
118    |
119 LL | type H = Fn(u8) -> (u8)::Output;
120    |          ^^^^^^^^^^^^^^^^^^^^^^ help: use fully-qualified syntax: `<(dyn Fn(u8) -> u8 + 'static) as Trait>::Output`
121
122 error[E0223]: ambiguous associated type
123   --> $DIR/bad-assoc-ty.rs:39:19
124    |
125 LL |     ($ty: ty) => ($ty::AssocTy);
126    |                   ^^^^^^^^^^^^ help: use fully-qualified syntax: `<u8 as Trait>::AssocTy`
127 ...
128 LL | type J = ty!(u8);
129    |          ------- in this macro invocation
130    |
131    = note: this error originates in the macro `ty` (in Nightly builds, run with -Z macro-backtrace for more info)
132
133 error[E0223]: ambiguous associated type
134   --> $DIR/bad-assoc-ty.rs:46:10
135    |
136 LL | type I = ty!()::AssocTy;
137    |          ^^^^^^^^^^^^^^ help: use fully-qualified syntax: `<u8 as Trait>::AssocTy`
138
139 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
140   --> $DIR/bad-assoc-ty.rs:51:13
141    |
142 LL | fn foo<X: K<_, _>>(x: X) {}
143    |             ^  ^ not allowed in type signatures
144    |             |
145    |             not allowed in type signatures
146    |
147 help: use type parameters instead
148    |
149 LL | fn foo<X: K<T, T>, T>(x: X) {}
150    |             ~  ~ +++
151
152 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
153   --> $DIR/bad-assoc-ty.rs:54:34
154    |
155 LL | fn bar<F>(_: F) where F: Fn() -> _ {}
156    |                                  ^ not allowed in type signatures
157    |
158 help: use type parameters instead
159    |
160 LL | fn bar<F, T>(_: F) where F: Fn() -> T {}
161    |         +++                         ~
162
163 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
164   --> $DIR/bad-assoc-ty.rs:57:19
165    |
166 LL | fn baz<F: Fn() -> _>(_: F) {}
167    |                   ^ not allowed in type signatures
168    |
169 help: use type parameters instead
170    |
171 LL | fn baz<F: Fn() -> T, T>(_: F) {}
172    |                   ~+++
173
174 error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
175   --> $DIR/bad-assoc-ty.rs:60:33
176    |
177 LL | struct L<F>(F) where F: Fn() -> _;
178    |                                 ^ not allowed in type signatures
179    |
180 help: use type parameters instead
181    |
182 LL | struct L<F, T>(F) where F: Fn() -> T;
183    |           +++                      ~
184
185 error[E0121]: the placeholder `_` is not allowed within types on item signatures for structs
186   --> $DIR/bad-assoc-ty.rs:62:30
187    |
188 LL | struct M<F> where F: Fn() -> _ {
189    |                              ^ not allowed in type signatures
190    |
191 help: use type parameters instead
192    |
193 LL | struct M<F, T> where F: Fn() -> T {
194    |           +++                   ~
195
196 error[E0121]: the placeholder `_` is not allowed within types on item signatures for enums
197   --> $DIR/bad-assoc-ty.rs:66:28
198    |
199 LL | enum N<F> where F: Fn() -> _ {
200    |                            ^ not allowed in type signatures
201    |
202 help: use type parameters instead
203    |
204 LL | enum N<F, T> where F: Fn() -> T {
205    |         +++                   ~
206
207 error[E0121]: the placeholder `_` is not allowed within types on item signatures for unions
208   --> $DIR/bad-assoc-ty.rs:71:29
209    |
210 LL | union O<F> where F: Fn() -> _ {
211    |                             ^ not allowed in type signatures
212    |
213 help: use type parameters instead
214    |
215 LL | union O<F, T> where F: Fn() -> T {
216    |          +++                   ~
217
218 error[E0121]: the placeholder `_` is not allowed within types on item signatures for traits
219   --> $DIR/bad-assoc-ty.rs:76:29
220    |
221 LL | trait P<F> where F: Fn() -> _ {
222    |                             ^ not allowed in type signatures
223    |
224 help: use type parameters instead
225    |
226 LL | trait P<F, T> where F: Fn() -> T {
227    |          +++                   ~
228
229 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
230   --> $DIR/bad-assoc-ty.rs:81:38
231    |
232 LL |     fn foo<F>(_: F) where F: Fn() -> _ {}
233    |                                      ^ not allowed in type signatures
234    |
235 help: use type parameters instead
236    |
237 LL |     fn foo<F, T>(_: F) where F: Fn() -> T {}
238    |             +++                         ~
239
240 error: aborting due to 28 previous errors; 1 warning emitted
241
242 Some errors have detailed explanations: E0121, E0223.
243 For more information about an error, try `rustc --explain E0121`.