summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.rs
blob: 02599d7c05b593b0ad8dd8676cf9f63fad4e81d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![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!");
    }
}