diff --git a/tests/const-generic-default.rs b/tests/const-generic-default.rs new file mode 100644 index 0000000..65fdf49 --- /dev/null +++ b/tests/const-generic-default.rs @@ -0,0 +1,14 @@ +use std::convert::Infallible; + +use pinned_init::*; + +#[pin_data] +struct Array { + array: [u8; N], +} + +#[test] +fn create_array() { + stack_pin_init!(let array: Array<1024> = init!(Array { array <- zeroed::<_, Infallible>() })); + println!("{}", array.array.len()); +}