bytemuck/tests/array_tests.rs
Connor Horman cd8dbd64e9
Attach min_const_generics to a crate feature (#63)
* Attach min_const_generics to a crate feature

* Remove `min_const_generics` detection logic
2021-06-05 08:25:57 -06:00

13 lines
251 B
Rust

#[test]
pub fn test_cast_array() {
let x = [0u32, 1u32, 2u32];
let _: [u16; 6] = bytemuck::cast(x);
}
#[cfg(feature = "min_const_generics")]
#[test]
pub fn test_cast_long_array() {
let x = [0u32; 65];
let _: [u16; 130] = bytemuck::cast(x);
}