]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/large_enum_variant.stderr
Auto merge of #102536 - scottmcm:lookup_line-tweak, r=jackh726
[rust.git] / src / tools / clippy / tests / ui / large_enum_variant.stderr
1 error: large size difference between variants
2   --> $DIR/large_enum_variant.rs:10:1
3    |
4 LL | / enum LargeEnum {
5 LL | |     A(i32),
6    | |     ------ the second-largest variant contains at least 4 bytes
7 LL | |     B([i32; 8000]),
8    | |     -------------- the largest variant contains at least 32000 bytes
9 LL | | }
10    | |_^ the entire enum is at least 32004 bytes
11    |
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
14    |
15 LL |     B(Box<[i32; 8000]>),
16    |       ~~~~~~~~~~~~~~~~
17
18 error: large size difference between variants
19   --> $DIR/large_enum_variant.rs:34:1
20    |
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
26 LL | | }
27    | |_^ the entire enum is at least 32004 bytes
28    |
29 help: consider boxing the large fields to reduce the total size of the enum
30    |
31 LL |     ContainingLargeEnum(Box<LargeEnum>),
32    |                         ~~~~~~~~~~~~~~
33
34 error: large size difference between variants
35   --> $DIR/large_enum_variant.rs:39:1
36    |
37 LL | / enum LargeEnum3 {
38 LL | |     ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
39    | |     --------------------------------------------------------- the largest variant contains at least 70004 bytes
40 LL | |     VoidVariant,
41 LL | |     StructLikeLittle { x: i32, y: i32 },
42    | |     ----------------------------------- the second-largest variant contains at least 8 bytes
43 LL | | }
44    | |_^ the entire enum is at least 70008 bytes
45    |
46 help: consider boxing the large fields to reduce the total size of the enum
47    |
48 LL |     ContainingMoreThanOneField(i32, Box<[i32; 8000]>, Box<[i32; 9500]>),
49    |                                     ~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~
50
51 error: large size difference between variants
52   --> $DIR/large_enum_variant.rs:45:1
53    |
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
59 LL | | }
60    | |_^ the entire enum is at least 32008 bytes
61    |
62 help: consider boxing the large fields to reduce the total size of the enum
63    |
64 LL |     StructLikeLarge { x: Box<[i32; 8000]>, y: i32 },
65    |                          ~~~~~~~~~~~~~~~~
66
67 error: large size difference between variants
68   --> $DIR/large_enum_variant.rs:50:1
69    |
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
75 LL | | }
76    | |_^ the entire enum is at least 32004 bytes
77    |
78 help: consider boxing the large fields to reduce the total size of the enum
79    |
80 LL |     StructLikeLarge2 { x: Box<[i32; 8000]> },
81    |                           ~~~~~~~~~~~~~~~~
82
83 error: large size difference between variants
84   --> $DIR/large_enum_variant.rs:66:1
85    |
86 LL | / enum LargeEnum7 {
87 LL | |     A,
88 LL | |     B([u8; 1255]),
89    | |     ------------- the largest variant contains at least 1255 bytes
90 LL | |     C([u8; 200]),
91    | |     ------------ the second-largest variant contains at least 200 bytes
92 LL | | }
93    | |_^ the entire enum is at least 1256 bytes
94    |
95 help: consider boxing the large fields to reduce the total size of the enum
96    |
97 LL |     B(Box<[u8; 1255]>),
98    |       ~~~~~~~~~~~~~~~
99
100 error: large size difference between variants
101   --> $DIR/large_enum_variant.rs:72:1
102    |
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
108 LL | | }
109    | |_^ the entire enum is at least 70132 bytes
110    |
111 help: consider boxing the large fields to reduce the total size of the enum
112    |
113 LL |     ContainingMoreThanOneField(Box<[i32; 8000]>, [i32; 2], Box<[i32; 9500]>, [i32; 30]),
114    |                                ~~~~~~~~~~~~~~~~            ~~~~~~~~~~~~~~~~
115
116 error: large size difference between variants
117   --> $DIR/large_enum_variant.rs:77:1
118    |
119 LL | / enum LargeEnum9 {
120 LL | |     A(Struct<()>),
121    | |     ------------- the second-largest variant contains at least 4 bytes
122 LL | |     B(Struct2),
123    | |     ---------- the largest variant contains at least 32000 bytes
124 LL | | }
125    | |_^ the entire enum is at least 32004 bytes
126    |
127 help: consider boxing the large fields to reduce the total size of the enum
128    |
129 LL |     B(Box<Struct2>),
130    |       ~~~~~~~~~~~~
131
132 error: large size difference between variants
133   --> $DIR/large_enum_variant.rs:82:1
134    |
135 LL | / enum LargeEnumOk2<T> {
136 LL | |     A(T),
137    | |     ---- the second-largest variant contains at least 0 bytes
138 LL | |     B(Struct2),
139    | |     ---------- the largest variant contains at least 32000 bytes
140 LL | | }
141    | |_^ the entire enum is at least 32000 bytes
142    |
143 help: consider boxing the large fields to reduce the total size of the enum
144    |
145 LL |     B(Box<Struct2>),
146    |       ~~~~~~~~~~~~
147
148 error: large size difference between variants
149   --> $DIR/large_enum_variant.rs:87:1
150    |
151 LL | / enum LargeEnumOk3<T> {
152 LL | |     A(Struct<T>),
153    | |     ------------ the second-largest variant contains at least 4 bytes
154 LL | |     B(Struct2),
155    | |     ---------- the largest variant contains at least 32000 bytes
156 LL | | }
157    | |_^ the entire enum is at least 32000 bytes
158    |
159 help: consider boxing the large fields to reduce the total size of the enum
160    |
161 LL |     B(Box<Struct2>),
162    |       ~~~~~~~~~~~~
163
164 error: large size difference between variants
165   --> $DIR/large_enum_variant.rs:102:1
166    |
167 LL | / enum CopyableLargeEnum {
168 LL | |     A(bool),
169    | |     ------- the second-largest variant contains at least 1 bytes
170 LL | |     B([u64; 8000]),
171    | |     -------------- the largest variant contains at least 64000 bytes
172 LL | | }
173    | |_^ the entire enum is at least 64008 bytes
174    |
175 note: boxing a variant would require the type no longer be `Copy`
176   --> $DIR/large_enum_variant.rs:102:6
177    |
178 LL | enum CopyableLargeEnum {
179    |      ^^^^^^^^^^^^^^^^^
180 help: consider boxing the large fields to reduce the total size of the enum
181   --> $DIR/large_enum_variant.rs:104:5
182    |
183 LL |     B([u64; 8000]),
184    |     ^^^^^^^^^^^^^^
185
186 error: large size difference between variants
187   --> $DIR/large_enum_variant.rs:107:1
188    |
189 LL | / enum ManuallyCopyLargeEnum {
190 LL | |     A(bool),
191    | |     ------- the second-largest variant contains at least 1 bytes
192 LL | |     B([u64; 8000]),
193    | |     -------------- the largest variant contains at least 64000 bytes
194 LL | | }
195    | |_^ the entire enum is at least 64008 bytes
196    |
197 note: boxing a variant would require the type no longer be `Copy`
198   --> $DIR/large_enum_variant.rs:107:6
199    |
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
204    |
205 LL |     B([u64; 8000]),
206    |     ^^^^^^^^^^^^^^
207
208 error: large size difference between variants
209   --> $DIR/large_enum_variant.rs:120:1
210    |
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
216 LL | | }
217    | |_^ the entire enum is at least 32008 bytes
218    |
219 note: boxing a variant would require the type no longer be `Copy`
220   --> $DIR/large_enum_variant.rs:120:6
221    |
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
226    |
227 LL |     B([u64; 4000]),
228    |     ^^^^^^^^^^^^^^
229
230 error: large size difference between variants
231   --> $DIR/large_enum_variant.rs:133:1
232    |
233 LL | / enum LargeEnumWithGenerics<T> {
234 LL | |     Small,
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
238 LL | | }
239    | |_^ the entire enum is at least 512 bytes
240    |
241 help: consider boxing the large fields to reduce the total size of the enum
242    |
243 LL |     Large(Box<(T, [u8; 512])>),
244    |           ~~~~~~~~~~~~~~~~~~~
245
246 error: large size difference between variants
247   --> $DIR/large_enum_variant.rs:142:1
248    |
249 LL | / enum WithGenerics {
250 LL | |     Large([Foo<u64>; 64]),
251    | |     --------------------- the largest variant contains at least 512 bytes
252 LL | |     Small(u8),
253    | |     --------- the second-largest variant contains at least 1 bytes
254 LL | | }
255    | |_^ the entire enum is at least 520 bytes
256    |
257 help: consider boxing the large fields to reduce the total size of the enum
258    |
259 LL |     Large(Box<[Foo<u64>; 64]>),
260    |           ~~~~~~~~~~~~~~~~~~~
261
262 error: large size difference between variants
263   --> $DIR/large_enum_variant.rs:152:1
264    |
265 LL | / enum LargeEnumOfConst {
266 LL | |     Ok,
267    | |     -- the second-largest variant carries no data at all
268 LL | |     Error(PossiblyLargeEnumWithConst<256>),
269    | |     -------------------------------------- the largest variant contains at least 514 bytes
270 LL | | }
271    | |_^ the entire enum is at least 514 bytes
272    |
273 help: consider boxing the large fields to reduce the total size of the enum
274    |
275 LL |     Error(Box<PossiblyLargeEnumWithConst<256>>),
276    |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
277
278 error: aborting due to 16 previous errors
279