about summary refs log tree commit diff
path: root/tests/ui/pattern/usefulness/const-partial_eq-fallback-ice.rs
blob: f09dcf8498f3876d3003102444d6f0fdd5361b04 (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 constant of non-structural type `MyType` in a pattern
        println!("did match!");
    }
}