1
1
error[E0423]: expected value, found struct variant `E::B`
2
- --> $DIR/fn-or-tuple-struct-without-args.rs:25 :16
2
+ --> $DIR/fn-or-tuple-struct-without-args.rs:36 :16
3
3
|
4
4
LL | let _: E = E::B;
5
5
| ^^^-
@@ -8,7 +8,7 @@ LL | let _: E = E::B;
8
8
| did you mean `E::B { /* fields */ }`?
9
9
10
10
error[E0308]: mismatched types
11
- --> $DIR/fn-or-tuple-struct-without-args.rs:18 :20
11
+ --> $DIR/fn-or-tuple-struct-without-args.rs:29 :20
12
12
|
13
13
LL | fn foo(a: usize, b: usize) -> usize { a }
14
14
| ----------------------------------- fn(usize, usize) -> usize {foo} defined here
@@ -23,7 +23,7 @@ LL | let _: usize = foo;
23
23
found type `fn(usize, usize) -> usize {foo}`
24
24
25
25
error[E0308]: mismatched types
26
- --> $DIR/fn-or-tuple-struct-without-args.rs:19 :16
26
+ --> $DIR/fn-or-tuple-struct-without-args.rs:30 :16
27
27
|
28
28
LL | struct S(usize, usize);
29
29
| ----------------------- fn(usize, usize) -> S {S} defined here
@@ -38,7 +38,7 @@ LL | let _: S = S;
38
38
found type `fn(usize, usize) -> S {S}`
39
39
40
40
error[E0308]: mismatched types
41
- --> $DIR/fn-or-tuple-struct-without-args.rs:20 :20
41
+ --> $DIR/fn-or-tuple-struct-without-args.rs:31 :20
42
42
|
43
43
LL | fn bar() -> usize { 42 }
44
44
| ----------------- fn() -> usize {bar} defined here
@@ -53,7 +53,7 @@ LL | let _: usize = bar;
53
53
found type `fn() -> usize {bar}`
54
54
55
55
error[E0308]: mismatched types
56
- --> $DIR/fn-or-tuple-struct-without-args.rs:21 :16
56
+ --> $DIR/fn-or-tuple-struct-without-args.rs:32 :16
57
57
|
58
58
LL | struct V();
59
59
| ----------- fn() -> V {V} defined here
@@ -68,7 +68,7 @@ LL | let _: V = V;
68
68
found type `fn() -> V {V}`
69
69
70
70
error[E0308]: mismatched types
71
- --> $DIR/fn-or-tuple-struct-without-args.rs:22 :20
71
+ --> $DIR/fn-or-tuple-struct-without-args.rs:33 :20
72
72
|
73
73
LL | fn baz(x: usize, y: usize) -> usize { x }
74
74
| ----------------------------------- fn(usize, usize) -> usize {<_ as T>::baz} defined here
@@ -77,28 +77,28 @@ LL | let _: usize = T::baz;
77
77
| ^^^^^^
78
78
| |
79
79
| expected usize, found fn item
80
- | help: use parentheses to call this function: `T::baz(... )`
80
+ | help: use parentheses to call this function: `T::baz(x, y )`
81
81
|
82
82
= note: expected type `usize`
83
83
found type `fn(usize, usize) -> usize {<_ as T>::baz}`
84
84
85
85
error[E0308]: mismatched types
86
- --> $DIR/fn-or-tuple-struct-without-args.rs:23 :20
86
+ --> $DIR/fn-or-tuple-struct-without-args.rs:34 :20
87
87
|
88
- LL | fn bat() -> usize { 42 }
89
- | ----------------- fn() -> usize {<_ as T>::bat} defined here
88
+ LL | fn bat(x: usize ) -> usize { 42 }
89
+ | ------------------------- fn(usize ) -> usize {<_ as T>::bat} defined here
90
90
...
91
91
LL | let _: usize = T::bat;
92
92
| ^^^^^^
93
93
| |
94
94
| expected usize, found fn item
95
- | help: use parentheses to call this function: `T::bat()`
95
+ | help: use parentheses to call this function: `T::bat(x )`
96
96
|
97
97
= note: expected type `usize`
98
- found type `fn() -> usize {<_ as T>::bat}`
98
+ found type `fn(usize ) -> usize {<_ as T>::bat}`
99
99
100
100
error[E0308]: mismatched types
101
- --> $DIR/fn-or-tuple-struct-without-args.rs:24 :16
101
+ --> $DIR/fn-or-tuple-struct-without-args.rs:35 :16
102
102
|
103
103
LL | A(usize),
104
104
| -------- fn(usize) -> E {E::A} defined here
@@ -112,7 +112,109 @@ LL | let _: E = E::A;
112
112
= note: expected type `E`
113
113
found type `fn(usize) -> E {E::A}`
114
114
115
- error: aborting due to 8 previous errors
115
+ error[E0308]: mismatched types
116
+ --> $DIR/fn-or-tuple-struct-without-args.rs:37:20
117
+ |
118
+ LL | fn baz(x: usize, y: usize) -> usize { x }
119
+ | ----------------------------------- fn(usize, usize) -> usize {<X as T>::baz} defined here
120
+ ...
121
+ LL | let _: usize = X::baz;
122
+ | ^^^^^^
123
+ | |
124
+ | expected usize, found fn item
125
+ | help: use parentheses to call this function: `X::baz(x, y)`
126
+ |
127
+ = note: expected type `usize`
128
+ found type `fn(usize, usize) -> usize {<X as T>::baz}`
129
+
130
+ error[E0308]: mismatched types
131
+ --> $DIR/fn-or-tuple-struct-without-args.rs:38:20
132
+ |
133
+ LL | fn bat(x: usize) -> usize { 42 }
134
+ | ------------------------- fn(usize) -> usize {<X as T>::bat} defined here
135
+ ...
136
+ LL | let _: usize = X::bat;
137
+ | ^^^^^^
138
+ | |
139
+ | expected usize, found fn item
140
+ | help: use parentheses to call this function: `X::bat(x)`
141
+ |
142
+ = note: expected type `usize`
143
+ found type `fn(usize) -> usize {<X as T>::bat}`
144
+
145
+ error[E0308]: mismatched types
146
+ --> $DIR/fn-or-tuple-struct-without-args.rs:39:20
147
+ |
148
+ LL | fn bax(x: usize) -> usize { 42 }
149
+ | ------------------------- fn(usize) -> usize {<X as T>::bax} defined here
150
+ ...
151
+ LL | let _: usize = X::bax;
152
+ | ^^^^^^
153
+ | |
154
+ | expected usize, found fn item
155
+ | help: use parentheses to call this function: `X::bax(x)`
156
+ |
157
+ = note: expected type `usize`
158
+ found type `fn(usize) -> usize {<X as T>::bax}`
159
+
160
+ error[E0308]: mismatched types
161
+ --> $DIR/fn-or-tuple-struct-without-args.rs:40:20
162
+ |
163
+ LL | fn bach(x: usize) -> usize;
164
+ | --------------------------- fn(usize) -> usize {<X as T>::bach} defined here
165
+ ...
166
+ LL | let _: usize = X::bach;
167
+ | ^^^^^^^
168
+ | |
169
+ | expected usize, found fn item
170
+ | help: use parentheses to call this function: `X::bach(x)`
171
+ |
172
+ = note: expected type `usize`
173
+ found type `fn(usize) -> usize {<X as T>::bach}`
174
+
175
+ error[E0308]: mismatched types
176
+ --> $DIR/fn-or-tuple-struct-without-args.rs:41:20
177
+ |
178
+ LL | fn ban(&self) -> usize { 42 }
179
+ | ---------------------- for<'r> fn(&'r X) -> usize {<X as T>::ban} defined here
180
+ ...
181
+ LL | let _: usize = X::ban;
182
+ | ^^^^^^
183
+ | |
184
+ | expected usize, found fn item
185
+ | help: use parentheses to call this function: `X::ban(_)`
186
+ |
187
+ = note: expected type `usize`
188
+ found type `for<'r> fn(&'r X) -> usize {<X as T>::ban}`
189
+
190
+ error[E0308]: mismatched types
191
+ --> $DIR/fn-or-tuple-struct-without-args.rs:42:20
192
+ |
193
+ LL | fn bal(&self) -> usize;
194
+ | ----------------------- for<'r> fn(&'r X) -> usize {<X as T>::bal} defined here
195
+ ...
196
+ LL | let _: usize = X::bal;
197
+ | ^^^^^^
198
+ | |
199
+ | expected usize, found fn item
200
+ | help: use parentheses to call this function: `X::bal(_)`
201
+ |
202
+ = note: expected type `usize`
203
+ found type `for<'r> fn(&'r X) -> usize {<X as T>::bal}`
204
+
205
+ error[E0615]: attempted to take value of method `ban` on type `X`
206
+ --> $DIR/fn-or-tuple-struct-without-args.rs:43:22
207
+ |
208
+ LL | let _: usize = X.ban;
209
+ | ^^^ help: use parentheses to call the method: `ban()`
210
+
211
+ error[E0615]: attempted to take value of method `bal` on type `X`
212
+ --> $DIR/fn-or-tuple-struct-without-args.rs:44:22
213
+ |
214
+ LL | let _: usize = X.bal;
215
+ | ^^^ help: use parentheses to call the method: `bal()`
216
+
217
+ error: aborting due to 16 previous errors
116
218
117
- Some errors have detailed explanations: E0308, E0423.
219
+ Some errors have detailed explanations: E0308, E0423, E0615 .
118
220
For more information about an error, try `rustc --explain E0308`.
0 commit comments