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

11 lines
248 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-29 03:05:54 -06:00
a: [(); (|| { 0 })()] //~ ERROR cannot call non-const closure
//~^ ERROR the trait bound
}
fn main() {}