mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
14 lines
260 B
Rust
14 lines
260 B
Rust
#![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`
|
|
}
|