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: a tuple variant with a similar name exists: `A`
13 | did you mean `E::B { /* fields */ }`?
15 error[E0308]: mismatched types
16 --> $DIR/fn-or-tuple-struct-without-args.rs:29:20
18 LL | fn foo(a: usize, b: usize) -> usize { a }
19 | ----------------------------------- fn(usize, usize) -> usize {foo} defined here
21 LL | let _: usize = foo;
24 | | expected `usize`, found fn item
25 | | help: use parentheses to call this function: `foo(a, b)`
26 | expected due to this
28 = note: expected type `usize`
29 found fn item `fn(usize, usize) -> usize {foo}`
31 error[E0308]: mismatched types
32 --> $DIR/fn-or-tuple-struct-without-args.rs:30:16
34 LL | struct S(usize, usize);
35 | ----------------------- fn(usize, usize) -> S {S} defined here
40 | | expected struct `S`, found fn item
41 | | help: use parentheses to instantiate this tuple struct: `S(_, _)`
42 | expected due to this
44 = note: expected struct `S`
45 found fn item `fn(usize, usize) -> S {S}`
47 error[E0308]: mismatched types
48 --> $DIR/fn-or-tuple-struct-without-args.rs:31:20
50 LL | fn bar() -> usize { 42 }
51 | ----------------- fn() -> usize {bar} defined here
53 LL | let _: usize = bar;
56 | | expected `usize`, found fn item
57 | | help: use parentheses to call this function: `bar()`
58 | expected due to this
60 = note: expected type `usize`
61 found fn item `fn() -> usize {bar}`
63 error[E0308]: mismatched types
64 --> $DIR/fn-or-tuple-struct-without-args.rs:32:16
67 | ----------- fn() -> V {V} defined here
72 | | expected struct `V`, found fn item
73 | | help: use parentheses to instantiate this tuple struct: `V()`
74 | expected due to this
76 = note: expected struct `V`
77 found fn item `fn() -> V {V}`
79 error[E0308]: mismatched types
80 --> $DIR/fn-or-tuple-struct-without-args.rs:33:20
82 LL | fn baz(x: usize, y: usize) -> usize { x }
83 | ----------------------------------- fn(usize, usize) -> usize {<_ as T>::baz} defined here
85 LL | let _: usize = T::baz;
88 | | expected `usize`, found fn item
89 | | help: use parentheses to call this function: `T::baz(x, y)`
90 | expected due to this
92 = note: expected type `usize`
93 found fn item `fn(usize, usize) -> usize {<_ as T>::baz}`
95 error[E0308]: mismatched types
96 --> $DIR/fn-or-tuple-struct-without-args.rs:34:20
98 LL | fn bat(x: usize) -> usize { 42 }
99 | ------------------------- fn(usize) -> usize {<_ as T>::bat} defined here
101 LL | let _: usize = T::bat;
104 | | expected `usize`, found fn item
105 | | help: use parentheses to call this function: `T::bat(x)`
106 | expected due to this
108 = note: expected type `usize`
109 found fn item `fn(usize) -> usize {<_ as T>::bat}`
111 error[E0308]: mismatched types
112 --> $DIR/fn-or-tuple-struct-without-args.rs:35:16
115 | -------- fn(usize) -> E {E::A} defined here
117 LL | let _: E = E::A;
120 | | expected enum `E`, found fn item
121 | | help: use parentheses to instantiate this tuple variant: `E::A(_)`
122 | expected due to this
124 = note: expected enum `E`
125 found fn item `fn(usize) -> E {E::A}`
127 error[E0308]: mismatched types
128 --> $DIR/fn-or-tuple-struct-without-args.rs:37:20
130 LL | fn baz(x: usize, y: usize) -> usize { x }
131 | ----------------------------------- fn(usize, usize) -> usize {<X as T>::baz} defined here
133 LL | let _: usize = X::baz;
136 | | expected `usize`, found fn item
137 | | help: use parentheses to call this function: `X::baz(x, y)`
138 | expected due to this
140 = note: expected type `usize`
141 found fn item `fn(usize, usize) -> usize {<X as T>::baz}`
143 error[E0308]: mismatched types
144 --> $DIR/fn-or-tuple-struct-without-args.rs:38:20
146 LL | fn bat(x: usize) -> usize { 42 }
147 | ------------------------- fn(usize) -> usize {<X as T>::bat} defined here
149 LL | let _: usize = X::bat;
152 | | expected `usize`, found fn item
153 | | help: use parentheses to call this function: `X::bat(x)`
154 | expected due to this
156 = note: expected type `usize`
157 found fn item `fn(usize) -> usize {<X as T>::bat}`
159 error[E0308]: mismatched types
160 --> $DIR/fn-or-tuple-struct-without-args.rs:39:20
162 LL | fn bax(x: usize) -> usize { 42 }
163 | ------------------------- fn(usize) -> usize {<X as T>::bax} defined here
165 LL | let _: usize = X::bax;
168 | | expected `usize`, found fn item
169 | | help: use parentheses to call this function: `X::bax(x)`
170 | expected due to this
172 = note: expected type `usize`
173 found fn item `fn(usize) -> usize {<X as T>::bax}`
175 error[E0308]: mismatched types
176 --> $DIR/fn-or-tuple-struct-without-args.rs:40:20
178 LL | fn bach(x: usize) -> usize;
179 | --------------------------- fn(usize) -> usize {<X as T>::bach} defined here
181 LL | let _: usize = X::bach;
184 | | expected `usize`, found fn item
185 | | help: use parentheses to call this function: `X::bach(x)`
186 | expected due to this
188 = note: expected type `usize`
189 found fn item `fn(usize) -> usize {<X as T>::bach}`
191 error[E0308]: mismatched types
192 --> $DIR/fn-or-tuple-struct-without-args.rs:41:20
194 LL | fn ban(&self) -> usize { 42 }
195 | ---------------------- for<'r> fn(&'r X) -> usize {<X as T>::ban} defined here
197 LL | let _: usize = X::ban;
200 | | expected `usize`, found fn item
201 | | help: use parentheses to call this function: `X::ban(_)`
202 | expected due to this
204 = note: expected type `usize`
205 found fn item `for<'r> fn(&'r X) -> usize {<X as T>::ban}`
207 error[E0308]: mismatched types
208 --> $DIR/fn-or-tuple-struct-without-args.rs:42:20
210 LL | fn bal(&self) -> usize;
211 | ----------------------- for<'r> fn(&'r X) -> usize {<X as T>::bal} defined here
213 LL | let _: usize = X::bal;
216 | | expected `usize`, found fn item
217 | | help: use parentheses to call this function: `X::bal(_)`
218 | expected due to this
220 = note: expected type `usize`
221 found fn item `for<'r> fn(&'r X) -> usize {<X as T>::bal}`
223 error[E0615]: attempted to take value of method `ban` on type `X`
224 --> $DIR/fn-or-tuple-struct-without-args.rs:43:22
226 LL | let _: usize = X.ban;
227 | ^^^ help: use parentheses to call the method: `ban()`
229 error[E0615]: attempted to take value of method `bal` on type `X`
230 --> $DIR/fn-or-tuple-struct-without-args.rs:44:22
232 LL | let _: usize = X.bal;
233 | ^^^ help: use parentheses to call the method: `bal()`
235 error[E0308]: mismatched types
236 --> $DIR/fn-or-tuple-struct-without-args.rs:46:20
238 LL | let closure = || 42;
239 | -- closure defined here
240 LL | let _: usize = closure;
243 | | expected `usize`, found closure
244 | | help: use parentheses to call this closure: `closure()`
245 | expected due to this
247 = note: expected type `usize`
248 found closure `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]`
250 error: aborting due to 17 previous errors
252 Some errors have detailed explanations: E0308, E0423, E0615.
253 For more information about an error, try `rustc --explain E0308`.