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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

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