summaryrefslogtreecommitdiffstats
path: root/tests/ui/feature-gates/feature-gate-offset-of-enum.rs
blob: e19dcf9f6a54c02db9e7b2577f03f3426179ff88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![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, One); //~ ERROR `One` is an enum variant; expected field at end of `offset_of`
                            //~| ERROR using enums in offset_of is experimental
    offset_of!(Alpha, Two.0); //~ ERROR using enums in offset_of is experimental
}