use read_only::embed;

mod m {
    use super::embed;

    #[embed]
    pub struct Device {
        #[readonly]
        handle: u64,
        pub mutable: i32,
    }

    impl Device {
        pub fn new(handle: u64, mutable: i32) -> Self {
            Self {
                read_only: ReadOnlyDevice { handle },
                mutable,
            }
        }
    }
}

fn main() {
    let mut dev = m::Device::new(42, 0);
    let _ = dev.handle;
    dev.mutable = 1;
    let _ = dev.mutable;
}
