diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/print_type_sizes/variants.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/print_type_sizes/variants.rs b/tests/ui/print_type_sizes/variants.rs new file mode 100644 index 000000000..5a3020520 --- /dev/null +++ b/tests/ui/print_type_sizes/variants.rs @@ -0,0 +1,18 @@ +// compile-flags: -Z print-type-sizes --crate-type=lib +// build-pass + +// This file illustrates two things: +// +// 1. Only types that appear in a monomorphized function appear in the +// print-type-sizes output, and +// +// 2. For an enum, the print-type-sizes output will also include the +// size of each variant. + +pub struct SevenBytes([u8; 7]); +pub struct FiftyBytes([u8; 50]); + +pub enum Enum { + Small(SevenBytes), + Large(FiftyBytes), +} |