rustc/tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.rs
2025-02-17 11:14:05 +01:00

19 lines
328 B
Rust

#![allow(warnings)]
struct MyType;
impl PartialEq<usize> for MyType {
fn eq(&self, y: &usize) -> bool {
true
}
}
const CONSTANT: &&MyType = &&MyType;
fn main() {
if let CONSTANT = &&MyType {
//~^ ERROR constant of non-structural type `MyType` in a pattern
println!("did match!");
}
}