From d24fd224ce569fbf92cbe7cfc33191eeae623e6a Mon Sep 17 00:00:00 2001 From: y86-dev Date: Thu, 11 Apr 2024 16:07:23 +0200 Subject: [PATCH] tests: add const-generic-default --- tests/const-generic-default.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/const-generic-default.rs 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()); +}