rust/tests/ui/consts/invalid-inline-const-in-match-arm.rs
Deadbeef b17e6680d6 Move const trait bounds checks to MIR constck
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.
2023-03-28 08:39:55 +00:00

11 lines
228 B
Rust

#![allow(incomplete_features)]
#![feature(inline_const_pat)]
fn main() {
match () {
const { (|| {})() } => {}
//~^ ERROR cannot call non-const closure in constants
//~| ERROR the trait bound
}
}