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