]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/arg-in-pat-1.rs
Rollup merge of #106859 - tialaramex:master, r=Nilstrieb
[rust.git] / tests / ui / const-generics / arg-in-pat-1.rs
1 // check-pass
2 enum ConstGenericEnum<const N: usize> {
3     Foo([i32; N]),
4     Bar,
5 }
6
7 fn foo<const N: usize>(val: &ConstGenericEnum<N>) {
8     if let ConstGenericEnum::<N>::Foo(field, ..) = val {}
9 }
10
11 fn bar<const N: usize>(val: &ConstGenericEnum<N>) {
12     match val {
13         ConstGenericEnum::<N>::Foo(field, ..) => (),
14         ConstGenericEnum::<N>::Bar => (),
15     }
16 }
17
18 fn main() {
19     match ConstGenericEnum::Bar {
20         ConstGenericEnum::<3>::Foo(field, ..) => (),
21         ConstGenericEnum::<3>::Bar => (),
22     }
23 }