@@ -2,7 +2,7 @@ error[E0308]: mismatched types
2
2
--> $DIR/fn-or-tuple-struct-without-args.rs:29:20
3
3
|
4
4
LL | fn foo(a: usize, b: usize) -> usize { a }
5
- | ----------------------------------- fn(usize, usize) -> usize { foo} defined here
5
+ | ----------------------------------- function ` foo` defined here
6
6
...
7
7
LL | let _: usize = foo;
8
8
| ----- ^^^ expected `usize`, found fn item
@@ -20,15 +20,15 @@ error[E0308]: mismatched types
20
20
--> $DIR/fn-or-tuple-struct-without-args.rs:30:16
21
21
|
22
22
LL | struct S(usize, usize);
23
- | -------- fn(usize, usize) -> S {S} defined here
23
+ | -------- `S` defines a struct constructor here, which should be called
24
24
...
25
25
LL | let _: S = S;
26
- | - ^ expected struct `S`, found fn item
26
+ | - ^ expected struct `S`, found struct constructor
27
27
| |
28
28
| expected due to this
29
29
|
30
- = note: expected struct `S`
31
- found fn item `fn(usize, usize) -> S {S}`
30
+ = note: expected struct `S`
31
+ found struct constructor `fn(usize, usize) -> S {S}`
32
32
help: use parentheses to construct this tuple struct
33
33
|
34
34
LL | let _: S = S(/* usize */, /* usize */);
@@ -38,7 +38,7 @@ error[E0308]: mismatched types
38
38
--> $DIR/fn-or-tuple-struct-without-args.rs:31:20
39
39
|
40
40
LL | fn bar() -> usize { 42 }
41
- | ----------------- fn() -> usize { bar} defined here
41
+ | ----------------- function ` bar` defined here
42
42
...
43
43
LL | let _: usize = bar;
44
44
| ----- ^^^ expected `usize`, found fn item
@@ -56,15 +56,15 @@ error[E0308]: mismatched types
56
56
--> $DIR/fn-or-tuple-struct-without-args.rs:32:16
57
57
|
58
58
LL | struct V();
59
- | -------- fn() -> V {V} defined here
59
+ | -------- `V` defines a struct constructor here, which should be called
60
60
...
61
61
LL | let _: V = V;
62
- | - ^ expected struct `V`, found fn item
62
+ | - ^ expected struct `V`, found struct constructor
63
63
| |
64
64
| expected due to this
65
65
|
66
- = note: expected struct `V`
67
- found fn item `fn() -> V {V}`
66
+ = note: expected struct `V`
67
+ found struct constructor `fn() -> V {V}`
68
68
help: use parentheses to construct this tuple struct
69
69
|
70
70
LL | let _: V = V();
@@ -74,7 +74,7 @@ error[E0308]: mismatched types
74
74
--> $DIR/fn-or-tuple-struct-without-args.rs:33:20
75
75
|
76
76
LL | fn baz(x: usize, y: usize) -> usize { x }
77
- | ----------------------------------- fn(usize, usize) -> usize {<_ as T>:: baz} defined here
77
+ | ----------------------------------- associated function ` baz` defined here
78
78
...
79
79
LL | let _: usize = T::baz;
80
80
| ----- ^^^^^^ expected `usize`, found fn item
@@ -92,7 +92,7 @@ error[E0308]: mismatched types
92
92
--> $DIR/fn-or-tuple-struct-without-args.rs:34:20
93
93
|
94
94
LL | fn bat(x: usize) -> usize { 42 }
95
- | ------------------------- fn(usize) -> usize {<_ as T>:: bat} defined here
95
+ | ------------------------- associated function ` bat` defined here
96
96
...
97
97
LL | let _: usize = T::bat;
98
98
| ----- ^^^^^^ expected `usize`, found fn item
@@ -110,15 +110,15 @@ error[E0308]: mismatched types
110
110
--> $DIR/fn-or-tuple-struct-without-args.rs:35:16
111
111
|
112
112
LL | A(usize),
113
- | - fn(usize) -> E {E::A} defined here
113
+ | - `A` defines an enum variant constructor here, which should be called
114
114
...
115
115
LL | let _: E = E::A;
116
- | - ^^^^ expected enum `E`, found fn item
116
+ | - ^^^^ expected enum `E`, found enum constructor
117
117
| |
118
118
| expected due to this
119
119
|
120
- = note: expected enum `E`
121
- found fn item `fn(usize) -> E {E::A}`
120
+ = note: expected enum `E`
121
+ found enum constructor `fn(usize) -> E {E::A}`
122
122
help: use parentheses to construct this tuple variant
123
123
|
124
124
LL | let _: E = E::A(/* usize */);
@@ -134,7 +134,7 @@ error[E0308]: mismatched types
134
134
--> $DIR/fn-or-tuple-struct-without-args.rs:37:20
135
135
|
136
136
LL | fn baz(x: usize, y: usize) -> usize { x }
137
- | ----------------------------------- fn(usize, usize) -> usize {<X as T>:: baz} defined here
137
+ | ----------------------------------- associated function ` baz` defined here
138
138
...
139
139
LL | let _: usize = X::baz;
140
140
| ----- ^^^^^^ expected `usize`, found fn item
@@ -152,7 +152,7 @@ error[E0308]: mismatched types
152
152
--> $DIR/fn-or-tuple-struct-without-args.rs:38:20
153
153
|
154
154
LL | fn bat(x: usize) -> usize { 42 }
155
- | ------------------------- fn(usize) -> usize {<X as T>:: bat} defined here
155
+ | ------------------------- associated function ` bat` defined here
156
156
...
157
157
LL | let _: usize = X::bat;
158
158
| ----- ^^^^^^ expected `usize`, found fn item
@@ -170,7 +170,7 @@ error[E0308]: mismatched types
170
170
--> $DIR/fn-or-tuple-struct-without-args.rs:39:20
171
171
|
172
172
LL | fn bax(x: usize) -> usize { 42 }
173
- | ------------------------- fn(usize) -> usize {<X as T>:: bax} defined here
173
+ | ------------------------- associated function ` bax` defined here
174
174
...
175
175
LL | let _: usize = X::bax;
176
176
| ----- ^^^^^^ expected `usize`, found fn item
@@ -188,7 +188,7 @@ error[E0308]: mismatched types
188
188
--> $DIR/fn-or-tuple-struct-without-args.rs:40:20
189
189
|
190
190
LL | fn bach(x: usize) -> usize;
191
- | --------------------------- fn(usize) -> usize {<X as T>:: bach} defined here
191
+ | --------------------------- associated function ` bach` defined here
192
192
...
193
193
LL | let _: usize = X::bach;
194
194
| ----- ^^^^^^^ expected `usize`, found fn item
@@ -206,7 +206,7 @@ error[E0308]: mismatched types
206
206
--> $DIR/fn-or-tuple-struct-without-args.rs:41:20
207
207
|
208
208
LL | fn ban(&self) -> usize { 42 }
209
- | ---------------------- for<'a> fn(&'a X) -> usize {<X as T>:: ban} defined here
209
+ | ---------------------- associated function ` ban` defined here
210
210
...
211
211
LL | let _: usize = X::ban;
212
212
| ----- ^^^^^^ expected `usize`, found fn item
@@ -224,7 +224,7 @@ error[E0308]: mismatched types
224
224
--> $DIR/fn-or-tuple-struct-without-args.rs:42:20
225
225
|
226
226
LL | fn bal(&self) -> usize;
227
- | ----------------------- for<'a> fn(&'a X) -> usize {<X as T>:: bal} defined here
227
+ | ----------------------- associated function ` bal` defined here
228
228
...
229
229
LL | let _: usize = X::bal;
230
230
| ----- ^^^^^^ expected `usize`, found fn item
0 commit comments