rust/src/test/ui/consts/issue-68542-closure-in-array-len.rs

10 lines
212 B
Rust
Raw Normal View History

// Regression test for issue #68542
// Tests that we don't ICE when a closure appears
// in the length part of an array.
struct Bug {
2021-12-09 17:10:05 +00:00
a: [(); (|| { 0 })()] //~ ERROR cannot call non-const fn
}
fn main() {}