large-variant Disallow variants that disproportionately enlarge an inline union An unusually large variant determines the storage required by every value of its union type. Instead, you SHOULD place the large payload behind Box when the smaller variants are common enough for the reduced inline size to matter. Keeping the payload inline can remain faster when the large variant dominates actual use. - Category: performance - Level: warning - Fix: none - Scope: module Reported struct Packet { bytes: [uint8; 256]; } newtype Message = int32 | Packet; Accepted import { Box } from "destack:memory"; struct Packet { bytes: [uint8; 256]; } newtype Message = int32 | Box; Prior art - Clippy ยท largeenumvariant language/linter/src/rules/performance/largevariant.rs:9