]> git.lizzy.rs Git - rust.git/blob - src/test/ui/match/issue-72896.rs
Auto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726
[rust.git] / src / test / ui / match / issue-72896.rs
1 // run-pass
2 trait EnumSetType {
3     type Repr;
4 }
5
6 enum Enum8 { }
7 impl EnumSetType for Enum8 {
8     type Repr = u8;
9 }
10
11 #[derive(PartialEq, Eq)]
12 struct EnumSet<T: EnumSetType> {
13     __enumset_underlying: T::Repr,
14 }
15
16 const CONST_SET: EnumSet<Enum8> = EnumSet { __enumset_underlying: 3 };
17
18 fn main() {
19     match CONST_SET {
20         CONST_SET => { /* ok */ }
21         _ => panic!("match fell through?"),
22     }
23 }