]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr
Merge commit 'd0cf3481a84e3aa68c2f185c460e282af36ebc42' into clippyup
[rust.git] / src / test / ui / suggestions / fn-or-tuple-struct-without-args.stderr
1 error[E0423]: expected value, found struct variant `E::B`
2   --> $DIR/fn-or-tuple-struct-without-args.rs:36:16
3    |
4 LL |     A(usize),
5    |     -------- similarly named tuple variant `A` defined here
6 LL |     B { a: usize },
7    |     -------------- `E::B` defined here
8 ...
9 LL |     let _: E = E::B;
10    |                ^^^^
11    |
12 help: use struct literal syntax instead
13    |
14 LL |     let _: E = E::B { a: val };
15    |                ~~~~~~~~~~~~~~~
16 help: a tuple variant with a similar name exists
17    |
18 LL |     let _: E = E::A;
19    |                   ~
20
21 error[E0308]: mismatched types
22   --> $DIR/fn-or-tuple-struct-without-args.rs:29:20
23    |
24 LL | fn foo(a: usize, b: usize) -> usize { a }
25    | ----------------------------------- fn(usize, usize) -> usize {foo} defined here
26 ...
27 LL |     let _: usize = foo;
28    |            -----   ^^^ expected `usize`, found fn item
29    |            |
30    |            expected due to this
31    |
32    = note: expected type `usize`
33            found fn item `fn(usize, usize) -> usize {foo}`
34 help: use parentheses to call this function
35    |
36 LL |     let _: usize = foo(a, b);
37    |                       ++++++
38
39 error[E0308]: mismatched types
40   --> $DIR/fn-or-tuple-struct-without-args.rs:30:16
41    |
42 LL | struct S(usize, usize);
43    | ----------------------- fn(usize, usize) -> S {S} defined here
44 ...
45 LL |     let _: S = S;
46    |            -   ^ expected struct `S`, found fn item
47    |            |
48    |            expected due to this
49    |
50    = note: expected struct `S`
51              found fn item `fn(usize, usize) -> S {S}`
52 help: use parentheses to instantiate this tuple struct
53    |
54 LL |     let _: S = S(_, _);
55    |                 ++++++
56
57 error[E0308]: mismatched types
58   --> $DIR/fn-or-tuple-struct-without-args.rs:31:20
59    |
60 LL | fn bar() -> usize { 42 }
61    | ----------------- fn() -> usize {bar} defined here
62 ...
63 LL |     let _: usize = bar;
64    |            -----   ^^^ expected `usize`, found fn item
65    |            |
66    |            expected due to this
67    |
68    = note: expected type `usize`
69            found fn item `fn() -> usize {bar}`
70 help: use parentheses to call this function
71    |
72 LL |     let _: usize = bar();
73    |                       ++
74
75 error[E0308]: mismatched types
76   --> $DIR/fn-or-tuple-struct-without-args.rs:32:16
77    |
78 LL | struct V();
79    | ----------- fn() -> V {V} defined here
80 ...
81 LL |     let _: V = V;
82    |            -   ^ expected struct `V`, found fn item
83    |            |
84    |            expected due to this
85    |
86    = note: expected struct `V`
87              found fn item `fn() -> V {V}`
88 help: use parentheses to instantiate this tuple struct
89    |
90 LL |     let _: V = V();
91    |                 ++
92
93 error[E0308]: mismatched types
94   --> $DIR/fn-or-tuple-struct-without-args.rs:33:20
95    |
96 LL |     fn baz(x: usize, y: usize) -> usize { x }
97    |     ----------------------------------- fn(usize, usize) -> usize {<_ as T>::baz} defined here
98 ...
99 LL |     let _: usize = T::baz;
100    |            -----   ^^^^^^ expected `usize`, found fn item
101    |            |
102    |            expected due to this
103    |
104    = note: expected type `usize`
105            found fn item `fn(usize, usize) -> usize {<_ as T>::baz}`
106 help: use parentheses to call this function
107    |
108 LL |     let _: usize = T::baz(x, y);
109    |                          ++++++
110
111 error[E0308]: mismatched types
112   --> $DIR/fn-or-tuple-struct-without-args.rs:34:20
113    |
114 LL |     fn bat(x: usize) -> usize { 42 }
115    |     ------------------------- fn(usize) -> usize {<_ as T>::bat} defined here
116 ...
117 LL |     let _: usize = T::bat;
118    |            -----   ^^^^^^ expected `usize`, found fn item
119    |            |
120    |            expected due to this
121    |
122    = note: expected type `usize`
123            found fn item `fn(usize) -> usize {<_ as T>::bat}`
124 help: use parentheses to call this function
125    |
126 LL |     let _: usize = T::bat(x);
127    |                          +++
128
129 error[E0308]: mismatched types
130   --> $DIR/fn-or-tuple-struct-without-args.rs:35:16
131    |
132 LL |     A(usize),
133    |     -------- fn(usize) -> E {E::A} defined here
134 ...
135 LL |     let _: E = E::A;
136    |            -   ^^^^ expected enum `E`, found fn item
137    |            |
138    |            expected due to this
139    |
140    = note: expected enum `E`
141            found fn item `fn(usize) -> E {E::A}`
142 help: use parentheses to instantiate this tuple variant
143    |
144 LL |     let _: E = E::A(_);
145    |                    +++
146
147 error[E0308]: mismatched types
148   --> $DIR/fn-or-tuple-struct-without-args.rs:37:20
149    |
150 LL |     fn baz(x: usize, y: usize) -> usize { x }
151    |     ----------------------------------- fn(usize, usize) -> usize {<X as T>::baz} defined here
152 ...
153 LL |     let _: usize = X::baz;
154    |            -----   ^^^^^^ expected `usize`, found fn item
155    |            |
156    |            expected due to this
157    |
158    = note: expected type `usize`
159            found fn item `fn(usize, usize) -> usize {<X as T>::baz}`
160 help: use parentheses to call this function
161    |
162 LL |     let _: usize = X::baz(x, y);
163    |                          ++++++
164
165 error[E0308]: mismatched types
166   --> $DIR/fn-or-tuple-struct-without-args.rs:38:20
167    |
168 LL |     fn bat(x: usize) -> usize { 42 }
169    |     ------------------------- fn(usize) -> usize {<X as T>::bat} defined here
170 ...
171 LL |     let _: usize = X::bat;
172    |            -----   ^^^^^^ expected `usize`, found fn item
173    |            |
174    |            expected due to this
175    |
176    = note: expected type `usize`
177            found fn item `fn(usize) -> usize {<X as T>::bat}`
178 help: use parentheses to call this function
179    |
180 LL |     let _: usize = X::bat(x);
181    |                          +++
182
183 error[E0308]: mismatched types
184   --> $DIR/fn-or-tuple-struct-without-args.rs:39:20
185    |
186 LL |     fn bax(x: usize) -> usize { 42 }
187    |     ------------------------- fn(usize) -> usize {<X as T>::bax} defined here
188 ...
189 LL |     let _: usize = X::bax;
190    |            -----   ^^^^^^ expected `usize`, found fn item
191    |            |
192    |            expected due to this
193    |
194    = note: expected type `usize`
195            found fn item `fn(usize) -> usize {<X as T>::bax}`
196 help: use parentheses to call this function
197    |
198 LL |     let _: usize = X::bax(x);
199    |                          +++
200
201 error[E0308]: mismatched types
202   --> $DIR/fn-or-tuple-struct-without-args.rs:40:20
203    |
204 LL |     fn bach(x: usize) -> usize;
205    |     --------------------------- fn(usize) -> usize {<X as T>::bach} defined here
206 ...
207 LL |     let _: usize = X::bach;
208    |            -----   ^^^^^^^ expected `usize`, found fn item
209    |            |
210    |            expected due to this
211    |
212    = note: expected type `usize`
213            found fn item `fn(usize) -> usize {<X as T>::bach}`
214 help: use parentheses to call this function
215    |
216 LL |     let _: usize = X::bach(x);
217    |                           +++
218
219 error[E0308]: mismatched types
220   --> $DIR/fn-or-tuple-struct-without-args.rs:41:20
221    |
222 LL |     fn ban(&self) -> usize { 42 }
223    |     ---------------------- for<'r> fn(&'r X) -> usize {<X as T>::ban} defined here
224 ...
225 LL |     let _: usize = X::ban;
226    |            -----   ^^^^^^ expected `usize`, found fn item
227    |            |
228    |            expected due to this
229    |
230    = note: expected type `usize`
231            found fn item `for<'r> fn(&'r X) -> usize {<X as T>::ban}`
232 help: use parentheses to call this function
233    |
234 LL |     let _: usize = X::ban(_);
235    |                          +++
236
237 error[E0308]: mismatched types
238   --> $DIR/fn-or-tuple-struct-without-args.rs:42:20
239    |
240 LL |     fn bal(&self) -> usize;
241    |     ----------------------- for<'r> fn(&'r X) -> usize {<X as T>::bal} defined here
242 ...
243 LL |     let _: usize = X::bal;
244    |            -----   ^^^^^^ expected `usize`, found fn item
245    |            |
246    |            expected due to this
247    |
248    = note: expected type `usize`
249            found fn item `for<'r> fn(&'r X) -> usize {<X as T>::bal}`
250 help: use parentheses to call this function
251    |
252 LL |     let _: usize = X::bal(_);
253    |                          +++
254
255 error[E0615]: attempted to take value of method `ban` on type `X`
256   --> $DIR/fn-or-tuple-struct-without-args.rs:43:22
257    |
258 LL |     let _: usize = X.ban;
259    |                      ^^^ method, not a field
260    |
261 help: use parentheses to call the method
262    |
263 LL |     let _: usize = X.ban();
264    |                         ++
265
266 error[E0615]: attempted to take value of method `bal` on type `X`
267   --> $DIR/fn-or-tuple-struct-without-args.rs:44:22
268    |
269 LL |     let _: usize = X.bal;
270    |                      ^^^ method, not a field
271    |
272 help: use parentheses to call the method
273    |
274 LL |     let _: usize = X.bal();
275    |                         ++
276
277 error[E0308]: mismatched types
278   --> $DIR/fn-or-tuple-struct-without-args.rs:46:20
279    |
280 LL |     let closure = || 42;
281    |                   ----- the found closure
282 LL |     let _: usize = closure;
283    |            -----   ^^^^^^^ expected `usize`, found closure
284    |            |
285    |            expected due to this
286    |
287    = note: expected type `usize`
288            found closure `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]`
289 help: use parentheses to call this closure
290    |
291 LL |     let _: usize = closure();
292    |                           ++
293
294 error: aborting due to 17 previous errors
295
296 Some errors have detailed explanations: E0308, E0423, E0615.
297 For more information about an error, try `rustc --explain E0308`.