]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/issue-89088.rs
Rollup merge of #98609 - TaKO8Ki:fix-ice-for-associated-constant-generics, r=lcnr
[rust.git] / src / test / ui / consts / issue-89088.rs
1 // Regression test for the ICE described in #89088.
2
3 // check-pass
4
5 #![allow(indirect_structural_match)]
6 use std::borrow::Cow;
7
8 const FOO: &A = &A::Field(Cow::Borrowed("foo"));
9
10 #[derive(PartialEq, Eq)]
11 enum A {
12     Field(Cow<'static, str>)
13 }
14
15 fn main() {
16     let var = A::Field(Cow::Borrowed("bar"));
17
18     match &var {
19         FOO => todo!(),
20         _ => todo!()
21     }
22 }