2023-12-05 16:15:26 -06:00
|
|
|
#![feature(offset_of_nested)]
|
2023-11-03 08:16:47 -05:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|