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