]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/arg-in-pat-3.rs
Auto merge of #106711 - albertlarsan68:use-ci-llvm-when-lld, r=jyn514
[rust.git] / tests / ui / const-generics / arg-in-pat-3.rs
1 // check-pass
2 struct Foo<const N: usize>;
3
4 fn bindingp() {
5     match Foo {
6         mut x @ Foo::<3> => {
7             let ref mut _x @ Foo::<3> = x;
8         }
9     }
10 }
11
12 struct Bar<const N: usize> {
13     field: Foo<N>,
14 }
15
16 fn structp() {
17     match todo!() {
18         Bar::<3> {
19             field: Foo::<3>,
20         } => (),
21     }
22 }
23
24 struct Baz<const N: usize>(Foo<N>);
25
26 fn tuplestructp() {
27     match Baz(Foo) {
28         Baz::<3>(Foo::<3>) => (),
29     }
30 }
31
32 impl<const N: usize> Baz<N> {
33     const ASSOC: usize = 3;
34 }
35
36 fn pathp() {
37     match 3 {
38         Baz::<3>::ASSOC => (),
39         _ => (),
40     }
41 }
42
43 fn main() {}