// Copyright Kani Contributors // SPDX-License-Identifier: Apache-2.0 OR MIT // Ensure Kani can compile `[e; N]` when `N` is a const generic. // Test from struct Foo { field: [u64; N], } impl Foo { fn new() -> Self { // Was a crash during codegen because N hadn't been "monomorphized" // and so could not be evaluated to a compile-time constant. Self { field: [0; N] } } } #[cfg(kani)] mod proofs { use super::*; #[kani::proof] fn hope_kani_does_not_crash() { let x = Foo::<32>::new(); assert!(x.field.len() == 32); } }