[−][src]Crate get_random_const
Simple compile time random generator
Example
use get_random_const::random; #[random] pub const RAND: i32 = 0; { #[random] static STATIC_ARRAY: [u8; 5] = []; #[random] static STATIC_ARRAY_SIGN: [i8; 5] = []; } { #[random] static STATIC_ARRAY: [u16; 10] = []; } { #[random] static STATIC_ARRAY: [i16; 10] = []; } { #[random] static STATIC_ARRAY: [u64; 12] = []; } { #[random] static STATIC_ARRAY: [i64; 12] = []; } #[random] static STATIC_LOLKA: i128 = 0; assert_ne!(STATIC_LOLKA, 0); #[random] const LOLKA: u32 = 0; assert_ne!(LOLKA, 0); #[random] const LOLKA_ARRAY: [u32; 32] = 0; //Requires #![feature(proc_macro_hygiene)] //#[random] //let lolka: u8; //assert_ne!(lolka, 0);
Attribute Macros
random |