]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const_in_pattern/issue-62614.rs
Rollup merge of #98609 - TaKO8Ki:fix-ice-for-associated-constant-generics, r=lcnr
[rust.git] / src / test / ui / consts / const_in_pattern / issue-62614.rs
1 // run-pass
2
3 struct Sum(u32, u32);
4
5 impl PartialEq for Sum {
6     fn eq(&self, other: &Self) -> bool { self.0 + self.1 == other.0 + other.1 }
7 }
8
9 impl Eq for Sum { }
10
11 #[derive(PartialEq, Eq)]
12 enum Eek {
13     TheConst,
14     UnusedByTheConst(Sum)
15 }
16
17 const THE_CONST: Eek = Eek::TheConst;
18
19 pub fn main() {
20     match Eek::UnusedByTheConst(Sum(1,2)) {
21         THE_CONST => { panic!(); }
22         _ => {}
23     }
24 }