]> git.proxmox.com Git - rustc.git/blob - src/test/ui/match/issue-72896.rs
New upstream version 1.66.0+dfsg1
[rustc.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 }