rust/tests/ui/offset-of/offset-of-enum.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
260 B
Rust
Raw Normal View History

2023-04-21 08:53:34 +00:00
#![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`
}