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