summary refs log tree commit diff
path: root/tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.rs
blob: f34093ef1498bad801aeb617f65129bbffd8f0bd (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)]`
        println!("did match!");
    }
}