@@ -2,10 +2,10 @@ error: large size difference between variants
2
2
--> $DIR/large_enum_variant.rs:12:5
3
3
|
4
4
LL | B([i32; 8000]),
5
- | ^^^^^^^^^^^^^^ this variant is 32000 bytes
5
+ | ^^^^^^^^^^^^^^ this variant contains at least 32000 bytes
6
6
|
7
7
= note: `-D clippy::large-enum-variant` implied by `-D warnings`
8
- note: and the second-largest variant is 4 bytes:
8
+ note: and the second-largest variant contains at least 4 bytes:
9
9
--> $DIR/large_enum_variant.rs:11:5
10
10
|
11
11
LL | A(i32),
@@ -19,9 +19,9 @@ error: large size difference between variants
19
19
--> $DIR/large_enum_variant.rs:36:5
20
20
|
21
21
LL | ContainingLargeEnum(LargeEnum),
22
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this variant is 32004 bytes
22
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this variant contains at least 32004 bytes
23
23
|
24
- note: and the second-largest variant is 8 bytes:
24
+ note: and the second-largest variant contains at least 8 bytes:
25
25
--> $DIR/large_enum_variant.rs:35:5
26
26
|
27
27
LL | VariantOk(i32, u32),
@@ -35,9 +35,9 @@ error: large size difference between variants
35
35
--> $DIR/large_enum_variant.rs:40:5
36
36
|
37
37
LL | ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
38
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this variant is 70004 bytes
38
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this variant contains at least 70004 bytes
39
39
|
40
- note: and the second-largest variant is 8 bytes:
40
+ note: and the second-largest variant contains at least 8 bytes:
41
41
--> $DIR/large_enum_variant.rs:42:5
42
42
|
43
43
LL | StructLikeLittle { x: i32, y: i32 },
@@ -51,9 +51,9 @@ error: large size difference between variants
51
51
--> $DIR/large_enum_variant.rs:47:5
52
52
|
53
53
LL | StructLikeLarge { x: [i32; 8000], y: i32 },
54
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this variant is 32004 bytes
54
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this variant contains at least 32004 bytes
55
55
|
56
- note: and the second-largest variant is 8 bytes:
56
+ note: and the second-largest variant contains at least 8 bytes:
57
57
--> $DIR/large_enum_variant.rs:46:5
58
58
|
59
59
LL | VariantOk(i32, u32),
@@ -67,9 +67,9 @@ error: large size difference between variants
67
67
--> $DIR/large_enum_variant.rs:52:5
68
68
|
69
69
LL | StructLikeLarge2 { x: [i32; 8000] },
70
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this variant is 32000 bytes
70
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this variant contains at least 32000 bytes
71
71
|
72
- note: and the second-largest variant is 8 bytes:
72
+ note: and the second-largest variant contains at least 8 bytes:
73
73
--> $DIR/large_enum_variant.rs:51:5
74
74
|
75
75
LL | VariantOk(i32, u32),
@@ -83,9 +83,9 @@ error: large size difference between variants
83
83
--> $DIR/large_enum_variant.rs:68:5
84
84
|
85
85
LL | B([u8; 1255]),
86
- | ^^^^^^^^^^^^^ this variant is 1255 bytes
86
+ | ^^^^^^^^^^^^^ this variant contains at least 1255 bytes
87
87
|
88
- note: and the second-largest variant is 200 bytes:
88
+ note: and the second-largest variant contains at least 200 bytes:
89
89
--> $DIR/large_enum_variant.rs:69:5
90
90
|
91
91
LL | C([u8; 200]),
@@ -99,9 +99,9 @@ error: large size difference between variants
99
99
--> $DIR/large_enum_variant.rs:74:5
100
100
|
101
101
LL | ContainingMoreThanOneField([i32; 8000], [i32; 2], [i32; 9500], [i32; 30]),
102
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this variant is 70128 bytes
102
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this variant contains at least 70128 bytes
103
103
|
104
- note: and the second-largest variant is 8 bytes:
104
+ note: and the second-largest variant contains at least 8 bytes:
105
105
--> $DIR/large_enum_variant.rs:73:5
106
106
|
107
107
LL | VariantOk(i32, u32),
@@ -115,9 +115,9 @@ error: large size difference between variants
115
115
--> $DIR/large_enum_variant.rs:79:5
116
116
|
117
117
LL | B(Struct2),
118
- | ^^^^^^^^^^ this variant is 32000 bytes
118
+ | ^^^^^^^^^^ this variant contains at least 32000 bytes
119
119
|
120
- note: and the second-largest variant is 4 bytes:
120
+ note: and the second-largest variant contains at least 4 bytes:
121
121
--> $DIR/large_enum_variant.rs:78:5
122
122
|
123
123
LL | A(Struct<()>),
@@ -127,13 +127,45 @@ help: consider boxing the large fields to reduce the total size of the enum
127
127
LL | B(Box<Struct2>),
128
128
| ~~~~~~~~~~~~
129
129
130
+ error: large size difference between variants
131
+ --> $DIR/large_enum_variant.rs:84:5
132
+ |
133
+ LL | B(Struct2),
134
+ | ^^^^^^^^^^ this variant contains at least 32000 bytes
135
+ |
136
+ note: and the second-largest variant contains at least 0 bytes:
137
+ --> $DIR/large_enum_variant.rs:83:5
138
+ |
139
+ LL | A(T),
140
+ | ^^^^
141
+ help: consider boxing the large fields to reduce the total size of the enum
142
+ |
143
+ LL | B(Box<Struct2>),
144
+ | ~~~~~~~~~~~~
145
+
146
+ error: large size difference between variants
147
+ --> $DIR/large_enum_variant.rs:89:5
148
+ |
149
+ LL | B(Struct2),
150
+ | ^^^^^^^^^^ this variant contains at least 32000 bytes
151
+ |
152
+ note: and the second-largest variant contains at least 4 bytes:
153
+ --> $DIR/large_enum_variant.rs:88:5
154
+ |
155
+ LL | A(Struct<T>),
156
+ | ^^^^^^^^^^^^
157
+ help: consider boxing the large fields to reduce the total size of the enum
158
+ |
159
+ LL | B(Box<Struct2>),
160
+ | ~~~~~~~~~~~~
161
+
130
162
error: large size difference between variants
131
163
--> $DIR/large_enum_variant.rs:104:5
132
164
|
133
165
LL | B([u128; 4000]),
134
- | ^^^^^^^^^^^^^^^ this variant is 64000 bytes
166
+ | ^^^^^^^^^^^^^^^ this variant contains at least 64000 bytes
135
167
|
136
- note: and the second-largest variant is 1 bytes:
168
+ note: and the second-largest variant contains at least 1 bytes:
137
169
--> $DIR/large_enum_variant.rs:103:5
138
170
|
139
171
LL | A(bool),
@@ -153,9 +185,9 @@ error: large size difference between variants
153
185
--> $DIR/large_enum_variant.rs:109:5
154
186
|
155
187
LL | B([u128; 4000]),
156
- | ^^^^^^^^^^^^^^^ this variant is 64000 bytes
188
+ | ^^^^^^^^^^^^^^^ this variant contains at least 64000 bytes
157
189
|
158
- note: and the second-largest variant is 1 bytes:
190
+ note: and the second-largest variant contains at least 1 bytes:
159
191
--> $DIR/large_enum_variant.rs:108:5
160
192
|
161
193
LL | A(bool),
@@ -175,9 +207,9 @@ error: large size difference between variants
175
207
--> $DIR/large_enum_variant.rs:122:5
176
208
|
177
209
LL | B([u64; 4000]),
178
- | ^^^^^^^^^^^^^^ this variant is 32000 bytes
210
+ | ^^^^^^^^^^^^^^ this variant contains at least 32000 bytes
179
211
|
180
- note: and the second-largest variant is 1 bytes:
212
+ note: and the second-largest variant contains at least 1 bytes:
181
213
--> $DIR/large_enum_variant.rs:121:5
182
214
|
183
215
LL | A(bool, std::marker::PhantomData<T>),
@@ -193,5 +225,53 @@ help: consider boxing the large fields to reduce the total size of the enum
193
225
LL | B([u64; 4000]),
194
226
| ^^^^^^^^^^^^^^
195
227
196
- error: aborting due to 11 previous errors
228
+ error: large size difference between variants
229
+ --> $DIR/large_enum_variant.rs:135:5
230
+ |
231
+ LL | Large((T, [u8; 512])),
232
+ | ^^^^^^^^^^^^^^^^^^^^^ this variant contains at least 512 bytes
233
+ |
234
+ note: and the second-largest variant carries no data at all
235
+ --> $DIR/large_enum_variant.rs:134:5
236
+ |
237
+ LL | Small,
238
+ | ^^^^^
239
+ help: consider boxing the large fields to reduce the total size of the enum
240
+ |
241
+ LL | Large(Box<(T, [u8; 512])>),
242
+ | ~~~~~~~~~~~~~~~~~~~
243
+
244
+ error: large size difference between variants
245
+ --> $DIR/large_enum_variant.rs:143:5
246
+ |
247
+ LL | Large([Foo<u64>; 64]),
248
+ | ^^^^^^^^^^^^^^^^^^^^^ this variant contains at least 512 bytes
249
+ |
250
+ note: and the second-largest variant contains at least 1 bytes:
251
+ --> $DIR/large_enum_variant.rs:144:5
252
+ |
253
+ LL | Small(u8),
254
+ | ^^^^^^^^^
255
+ help: consider boxing the large fields to reduce the total size of the enum
256
+ |
257
+ LL | Large(Box<[Foo<u64>; 64]>),
258
+ | ~~~~~~~~~~~~~~~~~~~
259
+
260
+ error: large size difference between variants
261
+ --> $DIR/large_enum_variant.rs:154:5
262
+ |
263
+ LL | Error(PossiblyLargeEnumWithConst<256>),
264
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this variant contains at least 514 bytes
265
+ |
266
+ note: and the second-largest variant carries no data at all
267
+ --> $DIR/large_enum_variant.rs:153:5
268
+ |
269
+ LL | Ok,
270
+ | ^^
271
+ help: consider boxing the large fields to reduce the total size of the enum
272
+ |
273
+ LL | Error(Box<PossiblyLargeEnumWithConst<256>>),
274
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
275
+
276
+ error: aborting due to 16 previous errors
197
277
0 commit comments