]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/issue-68393-let-pat-assoc-constant.rs
check_match: unify some lowering code and fix some ICEs
[rust.git] / src / test / ui / pattern / issue-68393-let-pat-assoc-constant.rs
1 pub enum EFoo {
2     A,
3 }
4
5 pub trait Foo {
6     const X: EFoo;
7 }
8
9 struct Abc;
10
11 impl Foo for Abc {
12     const X: EFoo = EFoo::A;
13 }
14
15 struct Def;
16 impl Foo for Def {
17     const X: EFoo = EFoo::A;
18 }
19
20 pub fn test<A: Foo, B: Foo>(arg: EFoo, A::X: EFoo) {
21     //~^ ERROR associated consts cannot be referenced in patterns
22     let A::X = arg;
23     //~^ ERROR associated consts cannot be referenced in patterns
24 }
25
26 fn main() {}