summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/issue-89088.rs
blob: 40cc665fb612bd325835d1c1652171261fc05a76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Regression test for the ICE described in #89088.

// check-pass

#![allow(indirect_structural_match)]
use std::borrow::Cow;

const FOO: &A = &A::Field(Cow::Borrowed("foo"));

#[derive(PartialEq, Eq)]
enum A {
    Field(Cow<'static, str>)
}

fn main() {
    let var = A::Field(Cow::Borrowed("bar"));

    match &var {
        FOO => todo!(),
        _ => todo!()
    }
}