rust/tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.rs

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

19 lines
324 B
Rust
Raw Normal View History

2022-11-17 09:30:42 -06:00
#![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 must be annotated with `#[derive(PartialEq, Eq)]`
println!("did match!");
2022-11-17 09:30:42 -06:00
}
}