File: array_tests.rs

package info (click to toggle)
rust-bytemuck 1.21.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 380 kB
  • sloc: makefile: 4
file content (12 lines) | stat: -rw-r--r-- 263 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
#[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);
}