1 2 3 4 5 6 7 8 9 10 11
#[no_mangle] pub extern fn rust_arch_bits() -> i32 { use std::mem::size_of; let s = size_of::<usize>() * 8; s as i32 } #[test] fn it_is_32_or_64(){ assert!(rust_arch_bits() == 32 || rust_arch_bits() == 64); }