blob: ca96c47b92bb57f6ddcd0f162950091607e45579 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
error: large size difference between variants
--> $DIR/enum_variant_size.rs:5:1
|
LL | / enum Bad {
LL | |
LL | | A(()),
| | ----- the second-largest variant contains at least 0 bytes
LL | | B([u8; 501]),
| | ------------ the largest variant contains at least 501 bytes
LL | | }
| |_^ the entire enum is at least 502 bytes
|
= note: `-D clippy::large-enum-variant` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::large_enum_variant)]`
help: consider boxing the large fields to reduce the total size of the enum
|
LL | B(Box<[u8; 501]>),
| ~~~~~~~~~~~~~~
error: aborting due to 1 previous error
|