]> git.lizzy.rs Git - rust.git/blob - src/test/ui/print_type_sizes/variants.rs
Merge commit '48d60ab7c505c6c1ebb042eacaafd8dc9f7a9267' into libgccjit-codegen
[rust.git] / src / test / ui / print_type_sizes / variants.rs
1 // compile-flags: -Z print-type-sizes
2 // build-pass
3
4 // This file illustrates two things:
5 //
6 // 1. Only types that appear in a monomorphized function appear in the
7 //    print-type-sizes output, and
8 //
9 // 2. For an enum, the print-type-sizes output will also include the
10 //    size of each variant.
11
12 #![feature(start)]
13
14 pub struct SevenBytes([u8;  7]);
15 pub struct FiftyBytes([u8; 50]);
16
17 pub enum Enum {
18     Small(SevenBytes),
19     Large(FiftyBytes),
20 }
21
22 #[start]
23 fn start(_: isize, _: *const *const u8) -> isize {
24     let _e: Enum;
25     0
26 }