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)]`
|
2022-11-21 09:52:18 -06:00
|
|
|
println!("did match!");
|
2022-11-17 09:30:42 -06:00
|
|
|
}
|
|
|
|
}
|