summaryrefslogtreecommitdiffstats
path: root/tests/ui/offset-of/offset-of-enum.rs
blob: d73505821ff5341ff54131c735e6a6b8cfd92ee4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#![feature(offset_of)]

use std::mem::offset_of;

enum Alpha {
    One(u8),
    Two(u8),
}

fn main() {
    offset_of!(Alpha::One, 0); //~ ERROR expected type, found variant `Alpha::One`
    offset_of!(Alpha, Two.0); //~ ERROR no field `Two` on type `Alpha`
}