Skip to content

Commit

Permalink
tests: add const-generic-default
Browse files Browse the repository at this point in the history
  • Loading branch information
y86-dev committed Apr 11, 2024
1 parent 6b66668 commit 42ec6dd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/const-generic-default.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use std::convert::Infallible;

use pinned_init::*;

#[pin_data]
struct Array<const N: usize = 0> {
array: [u8; N],
}

#[test]
fn create_array() {
stack_pin_init!(let array: Array<1024> = init!(Array { array <- zeroed::<_, Infallible>() }));
println!("{}", array.array.len());
}

0 comments on commit 42ec6dd

Please sign in to comment.