//! try_const use lol_io::*; mod foo { pub const _FOO: u32 = 3; } lol_io::consts! { pub struct Foo:u32 {} /// With some documentation pub struct Bar:u8 { const ITEM = 0; } // Note we have to pass the crate because this is evaluated as part of the // compilation step of the macro crate, (not our test crate). Therefore we // pass the crate member explitly. Normal code should not have this problem? #[derive(NativeBitFlags)] #[lol(crate=lol_io)] #[lol(from = "Other", field = "flag")] pub struct IsABitFlag: u8 { const FLAG = 0b0000_0001 } pub struct WithPath: u32 { const FOO = foo::_FOO; } } struct Other { flag: u8, } fn main() {}