summaryrefslogtreecommitdiffstats
path: root/src/test/ui/print_type_sizes/variants.rs
blob: 6c8553cc23ded83bffdef6a0a643b9bd099970df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// compile-flags: -Z print-type-sizes
// 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.

#![feature(start)]

pub struct SevenBytes([u8;  7]);
pub struct FiftyBytes([u8; 50]);

pub enum Enum {
    Small(SevenBytes),
    Large(FiftyBytes),
}

#[start]
fn start(_: isize, _: *const *const u8) -> isize {
    let _e: Enum;
    0
}