1 error[E0423]: expected value, found struct variant `E::B`
2 --> $DIR/fn-or-tuple-struct-without-args.rs:36:16
5 | -------- similarly named tuple variant `A` defined here
7 | -------------- `E::B` defined here
12 help: use struct literal syntax instead
14 LL | let _: E = E::B { a: val };
16 help: a tuple variant with a similar name exists
21 error[E0308]: mismatched types
22 --> $DIR/fn-or-tuple-struct-without-args.rs:29:20
24 LL | fn foo(a: usize, b: usize) -> usize { a }
25 | ----------------------------------- fn(usize, usize) -> usize {foo} defined here
27 LL | let _: usize = foo;
28 | ----- ^^^ expected `usize`, found fn item
30 | expected due to this
32 = note: expected type `usize`
33 found fn item `fn(usize, usize) -> usize {foo}`
34 help: use parentheses to call this function
36 LL | let _: usize = foo(/* usize */, /* usize */);
37 | ++++++++++++++++++++++++++
39 error[E0308]: mismatched types
40 --> $DIR/fn-or-tuple-struct-without-args.rs:30:16
42 LL | struct S(usize, usize);
43 | -------- fn(usize, usize) -> S {S} defined here
46 | - ^ expected struct `S`, found fn item
48 | expected due to this
50 = note: expected struct `S`
51 found fn item `fn(usize, usize) -> S {S}`
52 help: use parentheses to construct this tuple struct
54 LL | let _: S = S(/* usize */, /* usize */);
55 | ++++++++++++++++++++++++++
57 error[E0308]: mismatched types
58 --> $DIR/fn-or-tuple-struct-without-args.rs:31:20
60 LL | fn bar() -> usize { 42 }
61 | ----------------- fn() -> usize {bar} defined here
63 LL | let _: usize = bar;
64 | ----- ^^^ expected `usize`, found fn item
66 | expected due to this
68 = note: expected type `usize`
69 found fn item `fn() -> usize {bar}`
70 help: use parentheses to call this function
72 LL | let _: usize = bar();
75 error[E0308]: mismatched types
76 --> $DIR/fn-or-tuple-struct-without-args.rs:32:16
79 | -------- fn() -> V {V} defined here
82 | - ^ expected struct `V`, found fn item
84 | expected due to this
86 = note: expected struct `V`
87 found fn item `fn() -> V {V}`
88 help: use parentheses to construct this tuple struct
93 error[E0308]: mismatched types
94 --> $DIR/fn-or-tuple-struct-without-args.rs:33:20
96 LL | fn baz(x: usize, y: usize) -> usize { x }
97 | ----------------------------------- fn(usize, usize) -> usize {<_ as T>::baz} defined here
99 LL | let _: usize = T::baz;
100 | ----- ^^^^^^ expected `usize`, found fn item
102 | expected due to this
104 = note: expected type `usize`
105 found fn item `fn(usize, usize) -> usize {<_ as T>::baz}`
106 help: use parentheses to call this associated function
108 LL | let _: usize = T::baz(/* usize */, /* usize */);
109 | ++++++++++++++++++++++++++
111 error[E0308]: mismatched types
112 --> $DIR/fn-or-tuple-struct-without-args.rs:34:20
114 LL | fn bat(x: usize) -> usize { 42 }
115 | ------------------------- fn(usize) -> usize {<_ as T>::bat} defined here
117 LL | let _: usize = T::bat;
118 | ----- ^^^^^^ expected `usize`, found fn item
120 | expected due to this
122 = note: expected type `usize`
123 found fn item `fn(usize) -> usize {<_ as T>::bat}`
124 help: use parentheses to call this associated function
126 LL | let _: usize = T::bat(/* usize */);
129 error[E0308]: mismatched types
130 --> $DIR/fn-or-tuple-struct-without-args.rs:35:16
133 | - fn(usize) -> E {E::A} defined here
135 LL | let _: E = E::A;
136 | - ^^^^ expected enum `E`, found fn item
138 | expected due to this
140 = note: expected enum `E`
141 found fn item `fn(usize) -> E {E::A}`
142 help: use parentheses to construct this tuple variant
144 LL | let _: E = E::A(/* usize */);
147 error[E0308]: mismatched types
148 --> $DIR/fn-or-tuple-struct-without-args.rs:37:20
150 LL | fn baz(x: usize, y: usize) -> usize { x }
151 | ----------------------------------- fn(usize, usize) -> usize {<X as T>::baz} defined here
153 LL | let _: usize = X::baz;
154 | ----- ^^^^^^ expected `usize`, found fn item
156 | expected due to this
158 = note: expected type `usize`
159 found fn item `fn(usize, usize) -> usize {<X as T>::baz}`
160 help: use parentheses to call this associated function
162 LL | let _: usize = X::baz(/* usize */, /* usize */);
163 | ++++++++++++++++++++++++++
165 error[E0308]: mismatched types
166 --> $DIR/fn-or-tuple-struct-without-args.rs:38:20
168 LL | fn bat(x: usize) -> usize { 42 }
169 | ------------------------- fn(usize) -> usize {<X as T>::bat} defined here
171 LL | let _: usize = X::bat;
172 | ----- ^^^^^^ expected `usize`, found fn item
174 | expected due to this
176 = note: expected type `usize`
177 found fn item `fn(usize) -> usize {<X as T>::bat}`
178 help: use parentheses to call this associated function
180 LL | let _: usize = X::bat(/* usize */);
183 error[E0308]: mismatched types
184 --> $DIR/fn-or-tuple-struct-without-args.rs:39:20
186 LL | fn bax(x: usize) -> usize { 42 }
187 | ------------------------- fn(usize) -> usize {<X as T>::bax} defined here
189 LL | let _: usize = X::bax;
190 | ----- ^^^^^^ expected `usize`, found fn item
192 | expected due to this
194 = note: expected type `usize`
195 found fn item `fn(usize) -> usize {<X as T>::bax}`
196 help: use parentheses to call this associated function
198 LL | let _: usize = X::bax(/* usize */);
201 error[E0308]: mismatched types
202 --> $DIR/fn-or-tuple-struct-without-args.rs:40:20
204 LL | fn bach(x: usize) -> usize;
205 | --------------------------- fn(usize) -> usize {<X as T>::bach} defined here
207 LL | let _: usize = X::bach;
208 | ----- ^^^^^^^ expected `usize`, found fn item
210 | expected due to this
212 = note: expected type `usize`
213 found fn item `fn(usize) -> usize {<X as T>::bach}`
214 help: use parentheses to call this associated function
216 LL | let _: usize = X::bach(/* usize */);
219 error[E0308]: mismatched types
220 --> $DIR/fn-or-tuple-struct-without-args.rs:41:20
222 LL | fn ban(&self) -> usize { 42 }
223 | ---------------------- for<'a> fn(&'a X) -> usize {<X as T>::ban} defined here
225 LL | let _: usize = X::ban;
226 | ----- ^^^^^^ expected `usize`, found fn item
228 | expected due to this
230 = note: expected type `usize`
231 found fn item `for<'a> fn(&'a X) -> usize {<X as T>::ban}`
232 help: use parentheses to call this associated function
234 LL | let _: usize = X::ban(/* &X */);
237 error[E0308]: mismatched types
238 --> $DIR/fn-or-tuple-struct-without-args.rs:42:20
240 LL | fn bal(&self) -> usize;
241 | ----------------------- for<'a> fn(&'a X) -> usize {<X as T>::bal} defined here
243 LL | let _: usize = X::bal;
244 | ----- ^^^^^^ expected `usize`, found fn item
246 | expected due to this
248 = note: expected type `usize`
249 found fn item `for<'a> fn(&'a X) -> usize {<X as T>::bal}`
250 help: use parentheses to call this associated function
252 LL | let _: usize = X::bal(/* &X */);
255 error[E0615]: attempted to take value of method `ban` on type `X`
256 --> $DIR/fn-or-tuple-struct-without-args.rs:43:22
258 LL | let _: usize = X.ban;
259 | ^^^ method, not a field
261 help: use parentheses to call the method
263 LL | let _: usize = X.ban();
266 error[E0615]: attempted to take value of method `bal` on type `X`
267 --> $DIR/fn-or-tuple-struct-without-args.rs:44:22
269 LL | let _: usize = X.bal;
270 | ^^^ method, not a field
272 help: use parentheses to call the method
274 LL | let _: usize = X.bal();
277 error[E0308]: mismatched types
278 --> $DIR/fn-or-tuple-struct-without-args.rs:46:20
280 LL | let closure = || 42;
281 | -- the found closure
282 LL | let _: usize = closure;
283 | ----- ^^^^^^^ expected `usize`, found closure
285 | expected due to this
287 = note: expected type `usize`
288 found closure `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:21]`
289 help: use parentheses to call this closure
291 LL | let _: usize = closure();
294 error: aborting due to 17 previous errors
296 Some errors have detailed explanations: E0308, E0423, E0615.
297 For more information about an error, try `rustc --explain E0308`.