1 error: large size difference between variants
2 --> $DIR/large_enum_variant.rs:10:1
4 LL | / enum LargeEnum {
6 | | ------ the second-largest variant contains at least 4 bytes
8 | | -------------- the largest variant contains at least 32000 bytes
10 | |_^ the entire enum is at least 32004 bytes
12 = note: `-D clippy::large-enum-variant` implied by `-D warnings`
13 help: consider boxing the large fields to reduce the total size of the enum
15 LL | B(Box<[i32; 8000]>),
18 error: large size difference between variants
19 --> $DIR/large_enum_variant.rs:34:1
21 LL | / enum LargeEnum2 {
22 LL | | VariantOk(i32, u32),
23 | | ------------------- the second-largest variant contains at least 8 bytes
24 LL | | ContainingLargeEnum(LargeEnum),
25 | | ------------------------------ the largest variant contains at least 32004 bytes
27 | |_^ the entire enum is at least 32004 bytes
29 help: consider boxing the large fields to reduce the total size of the enum
31 LL | ContainingLargeEnum(Box<LargeEnum>),
34 error: large size difference between variants
35 --> $DIR/large_enum_variant.rs:39:1
37 LL | / enum LargeEnum3 {
38 LL | | ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
39 | | --------------------------------------------------------- the largest variant contains at least 70004 bytes
41 LL | | StructLikeLittle { x: i32, y: i32 },
42 | | ----------------------------------- the second-largest variant contains at least 8 bytes
44 | |_^ the entire enum is at least 70008 bytes
46 help: consider boxing the large fields to reduce the total size of the enum
48 LL | ContainingMoreThanOneField(i32, Box<[i32; 8000]>, Box<[i32; 9500]>),
49 | ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
51 error: large size difference between variants
52 --> $DIR/large_enum_variant.rs:45:1
54 LL | / enum LargeEnum4 {
55 LL | | VariantOk(i32, u32),
56 | | ------------------- the second-largest variant contains at least 8 bytes
57 LL | | StructLikeLarge { x: [i32; 8000], y: i32 },
58 | | ------------------------------------------ the largest variant contains at least 32004 bytes
60 | |_^ the entire enum is at least 32008 bytes
62 help: consider boxing the large fields to reduce the total size of the enum
64 LL | StructLikeLarge { x: Box<[i32; 8000]>, y: i32 },
67 error: large size difference between variants
68 --> $DIR/large_enum_variant.rs:50:1
70 LL | / enum LargeEnum5 {
71 LL | | VariantOk(i32, u32),
72 | | ------------------- the second-largest variant contains at least 8 bytes
73 LL | | StructLikeLarge2 { x: [i32; 8000] },
74 | | ----------------------------------- the largest variant contains at least 32000 bytes
76 | |_^ the entire enum is at least 32004 bytes
78 help: consider boxing the large fields to reduce the total size of the enum
80 LL | StructLikeLarge2 { x: Box<[i32; 8000]> },
83 error: large size difference between variants
84 --> $DIR/large_enum_variant.rs:66:1
86 LL | / enum LargeEnum7 {
89 | | ------------- the largest variant contains at least 1255 bytes
91 | | ------------ the second-largest variant contains at least 200 bytes
93 | |_^ the entire enum is at least 1256 bytes
95 help: consider boxing the large fields to reduce the total size of the enum
97 LL | B(Box<[u8; 1255]>),
100 error: large size difference between variants
101 --> $DIR/large_enum_variant.rs:72:1
103 LL | / enum LargeEnum8 {
104 LL | | VariantOk(i32, u32),
105 | | ------------------- the second-largest variant contains at least 8 bytes
106 LL | | ContainingMoreThanOneField([i32; 8000], [i32; 2], [i32; 9500], [i32; 30]),
107 | | ------------------------------------------------------------------------- the largest variant contains at least 70128 bytes
109 | |_^ the entire enum is at least 70132 bytes
111 help: consider boxing the large fields to reduce the total size of the enum
113 LL | ContainingMoreThanOneField(Box<[i32; 8000]>, [i32; 2], Box<[i32; 9500]>, [i32; 30]),
114 | ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
116 error: large size difference between variants
117 --> $DIR/large_enum_variant.rs:77:1
119 LL | / enum LargeEnum9 {
120 LL | | A(Struct<()>),
121 | | ------------- the second-largest variant contains at least 4 bytes
123 | | ---------- the largest variant contains at least 32000 bytes
125 | |_^ the entire enum is at least 32004 bytes
127 help: consider boxing the large fields to reduce the total size of the enum
129 LL | B(Box<Struct2>),
132 error: large size difference between variants
133 --> $DIR/large_enum_variant.rs:82:1
135 LL | / enum LargeEnumOk2<T> {
137 | | ---- the second-largest variant contains at least 0 bytes
139 | | ---------- the largest variant contains at least 32000 bytes
141 | |_^ the entire enum is at least 32000 bytes
143 help: consider boxing the large fields to reduce the total size of the enum
145 LL | B(Box<Struct2>),
148 error: large size difference between variants
149 --> $DIR/large_enum_variant.rs:87:1
151 LL | / enum LargeEnumOk3<T> {
153 | | ------------ the second-largest variant contains at least 4 bytes
155 | | ---------- the largest variant contains at least 32000 bytes
157 | |_^ the entire enum is at least 32000 bytes
159 help: consider boxing the large fields to reduce the total size of the enum
161 LL | B(Box<Struct2>),
164 error: large size difference between variants
165 --> $DIR/large_enum_variant.rs:102:1
167 LL | / enum CopyableLargeEnum {
169 | | ------- the second-largest variant contains at least 1 bytes
170 LL | | B([u64; 8000]),
171 | | -------------- the largest variant contains at least 64000 bytes
173 | |_^ the entire enum is at least 64008 bytes
175 note: boxing a variant would require the type no longer be `Copy`
176 --> $DIR/large_enum_variant.rs:102:6
178 LL | enum CopyableLargeEnum {
180 help: consider boxing the large fields to reduce the total size of the enum
181 --> $DIR/large_enum_variant.rs:104:5
186 error: large size difference between variants
187 --> $DIR/large_enum_variant.rs:107:1
189 LL | / enum ManuallyCopyLargeEnum {
191 | | ------- the second-largest variant contains at least 1 bytes
192 LL | | B([u64; 8000]),
193 | | -------------- the largest variant contains at least 64000 bytes
195 | |_^ the entire enum is at least 64008 bytes
197 note: boxing a variant would require the type no longer be `Copy`
198 --> $DIR/large_enum_variant.rs:107:6
200 LL | enum ManuallyCopyLargeEnum {
201 | ^^^^^^^^^^^^^^^^^^^^^
202 help: consider boxing the large fields to reduce the total size of the enum
203 --> $DIR/large_enum_variant.rs:109:5
208 error: large size difference between variants
209 --> $DIR/large_enum_variant.rs:120:1
211 LL | / enum SomeGenericPossiblyCopyEnum<T> {
212 LL | | A(bool, std::marker::PhantomData<T>),
213 | | ------------------------------------ the second-largest variant contains at least 1 bytes
214 LL | | B([u64; 4000]),
215 | | -------------- the largest variant contains at least 32000 bytes
217 | |_^ the entire enum is at least 32008 bytes
219 note: boxing a variant would require the type no longer be `Copy`
220 --> $DIR/large_enum_variant.rs:120:6
222 LL | enum SomeGenericPossiblyCopyEnum<T> {
223 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
224 help: consider boxing the large fields to reduce the total size of the enum
225 --> $DIR/large_enum_variant.rs:122:5
230 error: large size difference between variants
231 --> $DIR/large_enum_variant.rs:133:1
233 LL | / enum LargeEnumWithGenerics<T> {
235 | | ----- the second-largest variant carries no data at all
236 LL | | Large((T, [u8; 512])),
237 | | --------------------- the largest variant contains at least 512 bytes
239 | |_^ the entire enum is at least 512 bytes
241 help: consider boxing the large fields to reduce the total size of the enum
243 LL | Large(Box<(T, [u8; 512])>),
244 | ~~~~~~~~~~~~~~~~~~~
246 error: large size difference between variants
247 --> $DIR/large_enum_variant.rs:142:1
249 LL | / enum WithGenerics {
250 LL | | Large([Foo<u64>; 64]),
251 | | --------------------- the largest variant contains at least 512 bytes
253 | | --------- the second-largest variant contains at least 1 bytes
255 | |_^ the entire enum is at least 520 bytes
257 help: consider boxing the large fields to reduce the total size of the enum
259 LL | Large(Box<[Foo<u64>; 64]>),
260 | ~~~~~~~~~~~~~~~~~~~
262 error: large size difference between variants
263 --> $DIR/large_enum_variant.rs:152:1
265 LL | / enum LargeEnumOfConst {
267 | | -- the second-largest variant carries no data at all
268 LL | | Error(PossiblyLargeEnumWithConst<256>),
269 | | -------------------------------------- the largest variant contains at least 514 bytes
271 | |_^ the entire enum is at least 514 bytes
273 help: consider boxing the large fields to reduce the total size of the enum
275 LL | Error(Box<PossiblyLargeEnumWithConst<256>>),
276 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
278 error: aborting due to 16 previous errors