rust/tests/ui/consts/const-meth-pattern.rs
2024-02-16 20:02:50 +00:00

19 lines
213 B
Rust

//@ run-pass
struct A;
impl A {
const fn banana() -> bool {
true
}
}
const ABANANA: bool = A::banana();
fn main() {
match true {
ABANANA => {},
_ => panic!("what?")
}
}