1 error[E0423]: expected value, found struct variant `E::B`
2 --> $DIR/fn-or-tuple-struct-without-args.rs:36:16
5 | -------------- `E::B` defined here
10 | | help: a tuple variant with a similar name exists: `A`
11 | did you mean `E::B { /* fields */ }`?
13 error[E0308]: mismatched types
14 --> $DIR/fn-or-tuple-struct-without-args.rs:29:20
16 LL | fn foo(a: usize, b: usize) -> usize { a }
17 | ----------------------------------- fn(usize, usize) -> usize {foo} defined here
19 LL | let _: usize = foo;
22 | expected usize, found fn item
23 | help: use parentheses to call this function: `foo(a, b)`
25 = note: expected type `usize`
26 found type `fn(usize, usize) -> usize {foo}`
28 error[E0308]: mismatched types
29 --> $DIR/fn-or-tuple-struct-without-args.rs:30:16
31 LL | struct S(usize, usize);
32 | ----------------------- fn(usize, usize) -> S {S} defined here
37 | expected struct `S`, found fn item
38 | help: use parentheses to instantiate this tuple struct: `S(_, _)`
40 = note: expected type `S`
41 found type `fn(usize, usize) -> S {S}`
43 error[E0308]: mismatched types
44 --> $DIR/fn-or-tuple-struct-without-args.rs:31:20
46 LL | fn bar() -> usize { 42 }
47 | ----------------- fn() -> usize {bar} defined here
49 LL | let _: usize = bar;
52 | expected usize, found fn item
53 | help: use parentheses to call this function: `bar()`
55 = note: expected type `usize`
56 found type `fn() -> usize {bar}`
58 error[E0308]: mismatched types
59 --> $DIR/fn-or-tuple-struct-without-args.rs:32:16
62 | ----------- fn() -> V {V} defined here
67 | expected struct `V`, found fn item
68 | help: use parentheses to instantiate this tuple struct: `V()`
70 = note: expected type `V`
71 found type `fn() -> V {V}`
73 error[E0308]: mismatched types
74 --> $DIR/fn-or-tuple-struct-without-args.rs:33:20
76 LL | fn baz(x: usize, y: usize) -> usize { x }
77 | ----------------------------------- fn(usize, usize) -> usize {<_ as T>::baz} defined here
79 LL | let _: usize = T::baz;
82 | expected usize, found fn item
83 | help: use parentheses to call this function: `T::baz(x, y)`
85 = note: expected type `usize`
86 found type `fn(usize, usize) -> usize {<_ as T>::baz}`
88 error[E0308]: mismatched types
89 --> $DIR/fn-or-tuple-struct-without-args.rs:34:20
91 LL | fn bat(x: usize) -> usize { 42 }
92 | ------------------------- fn(usize) -> usize {<_ as T>::bat} defined here
94 LL | let _: usize = T::bat;
97 | expected usize, found fn item
98 | help: use parentheses to call this function: `T::bat(x)`
100 = note: expected type `usize`
101 found type `fn(usize) -> usize {<_ as T>::bat}`
103 error[E0308]: mismatched types
104 --> $DIR/fn-or-tuple-struct-without-args.rs:35:16
107 | -------- fn(usize) -> E {E::A} defined here
109 LL | let _: E = E::A;
112 | expected enum `E`, found fn item
113 | help: use parentheses to instantiate this tuple variant: `E::A(_)`
115 = note: expected type `E`
116 found type `fn(usize) -> E {E::A}`
118 error[E0308]: mismatched types
119 --> $DIR/fn-or-tuple-struct-without-args.rs:37:20
121 LL | fn baz(x: usize, y: usize) -> usize { x }
122 | ----------------------------------- fn(usize, usize) -> usize {<X as T>::baz} defined here
124 LL | let _: usize = X::baz;
127 | expected usize, found fn item
128 | help: use parentheses to call this function: `X::baz(x, y)`
130 = note: expected type `usize`
131 found type `fn(usize, usize) -> usize {<X as T>::baz}`
133 error[E0308]: mismatched types
134 --> $DIR/fn-or-tuple-struct-without-args.rs:38:20
136 LL | fn bat(x: usize) -> usize { 42 }
137 | ------------------------- fn(usize) -> usize {<X as T>::bat} defined here
139 LL | let _: usize = X::bat;
142 | expected usize, found fn item
143 | help: use parentheses to call this function: `X::bat(x)`
145 = note: expected type `usize`
146 found type `fn(usize) -> usize {<X as T>::bat}`
148 error[E0308]: mismatched types
149 --> $DIR/fn-or-tuple-struct-without-args.rs:39:20
151 LL | fn bax(x: usize) -> usize { 42 }
152 | ------------------------- fn(usize) -> usize {<X as T>::bax} defined here
154 LL | let _: usize = X::bax;
157 | expected usize, found fn item
158 | help: use parentheses to call this function: `X::bax(x)`
160 = note: expected type `usize`
161 found type `fn(usize) -> usize {<X as T>::bax}`
163 error[E0308]: mismatched types
164 --> $DIR/fn-or-tuple-struct-without-args.rs:40:20
166 LL | fn bach(x: usize) -> usize;
167 | --------------------------- fn(usize) -> usize {<X as T>::bach} defined here
169 LL | let _: usize = X::bach;
172 | expected usize, found fn item
173 | help: use parentheses to call this function: `X::bach(x)`
175 = note: expected type `usize`
176 found type `fn(usize) -> usize {<X as T>::bach}`
178 error[E0308]: mismatched types
179 --> $DIR/fn-or-tuple-struct-without-args.rs:41:20
181 LL | fn ban(&self) -> usize { 42 }
182 | ---------------------- for<'r> fn(&'r X) -> usize {<X as T>::ban} defined here
184 LL | let _: usize = X::ban;
187 | expected usize, found fn item
188 | help: use parentheses to call this function: `X::ban(_)`
190 = note: expected type `usize`
191 found type `for<'r> fn(&'r X) -> usize {<X as T>::ban}`
193 error[E0308]: mismatched types
194 --> $DIR/fn-or-tuple-struct-without-args.rs:42:20
196 LL | fn bal(&self) -> usize;
197 | ----------------------- for<'r> fn(&'r X) -> usize {<X as T>::bal} defined here
199 LL | let _: usize = X::bal;
202 | expected usize, found fn item
203 | help: use parentheses to call this function: `X::bal(_)`
205 = note: expected type `usize`
206 found type `for<'r> fn(&'r X) -> usize {<X as T>::bal}`
208 error[E0615]: attempted to take value of method `ban` on type `X`
209 --> $DIR/fn-or-tuple-struct-without-args.rs:43:22
211 LL | let _: usize = X.ban;
212 | ^^^ help: use parentheses to call the method: `ban()`
214 error[E0615]: attempted to take value of method `bal` on type `X`
215 --> $DIR/fn-or-tuple-struct-without-args.rs:44:22
217 LL | let _: usize = X.bal;
218 | ^^^ help: use parentheses to call the method: `bal()`
220 error[E0308]: mismatched types
221 --> $DIR/fn-or-tuple-struct-without-args.rs:46:20
223 LL | let closure = || 42;
224 | -- closure defined here
225 LL | let _: usize = closure;
228 | expected usize, found closure
229 | help: use parentheses to call this closure: `closure()`
231 = note: expected type `usize`
232 found type `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]`
234 error: aborting due to 17 previous errors
236 Some errors have detailed explanations: E0308, E0423, E0615.
237 For more information about an error, try `rustc --explain E0308`.