mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
b17e6680d6
Fixes #109543. When checking paths in HIR typeck, we don't want to check for const predicates since all we want might just be a function pointer. Therefore we move this to MIR constck and check that bounds are met during MIR constck.
11 lines
248 B
Rust
11 lines
248 B
Rust
// Regression test for issue #68542
|
|
// Tests that we don't ICE when a closure appears
|
|
// in the length part of an array.
|
|
|
|
struct Bug {
|
|
a: [(); (|| { 0 })()] //~ ERROR cannot call non-const closure
|
|
//~^ ERROR the trait bound
|
|
}
|
|
|
|
fn main() {}
|