1- error[E0158]: constant pattern depends on a generic parameter
1+ error[E0158]: constant pattern depends on a generic parameter, which is not allowed
22 --> $DIR/associated-const-type-parameter-pattern.rs:20:9
33 |
44LL | pub trait Foo {
55 | -------------
66LL | const X: EFoo;
77 | ------------- constant defined here
88...
9+ LL | pub fn test<A: Foo, B: Foo>(arg: EFoo) {
10+ | - constant depends on this generic param
11+ LL | match arg {
912LL | A::X => println!("A::X"),
10- | ^^^^
13+ | ^^^^ `const` depends on a generic parameter
1114
12- error[E0158]: constant pattern depends on a generic parameter
15+ error[E0158]: constant pattern depends on a generic parameter, which is not allowed
1316 --> $DIR/associated-const-type-parameter-pattern.rs:22:9
1417 |
1518LL | pub trait Foo {
1619 | -------------
1720LL | const X: EFoo;
1821 | ------------- constant defined here
1922...
23+ LL | pub fn test<A: Foo, B: Foo>(arg: EFoo) {
24+ | - constant depends on this generic param
25+ ...
2026LL | B::X => println!("B::X"),
21- | ^^^^
27+ | ^^^^ `const` depends on a generic parameter
2228
23- error[E0158]: constant pattern depends on a generic parameter
29+ error[E0158]: constant pattern depends on a generic parameter, which is not allowed
2430 --> $DIR/associated-const-type-parameter-pattern.rs:30:9
2531 |
2632LL | pub trait Foo {
2733 | -------------
2834LL | const X: EFoo;
2935 | ------------- constant defined here
3036...
37+ LL | pub fn test_let_pat<A: Foo, B: Foo>(arg: EFoo, A::X: EFoo) {
38+ | - constant depends on this generic param
39+ LL |
3140LL | let A::X = arg;
32- | ^^^^
41+ | ^^^^ `const` depends on a generic parameter
3342
34- error[E0158]: constant pattern depends on a generic parameter
43+ error[E0158]: constant pattern depends on a generic parameter, which is not allowed
3544 --> $DIR/associated-const-type-parameter-pattern.rs:28:48
3645 |
3746LL | pub trait Foo {
@@ -40,7 +49,9 @@ LL | const X: EFoo;
4049 | ------------- constant defined here
4150...
4251LL | pub fn test_let_pat<A: Foo, B: Foo>(arg: EFoo, A::X: EFoo) {
43- | ^^^^
52+ | - ^^^^ `const` depends on a generic parameter
53+ | |
54+ | constant depends on this generic param
4455
4556error: aborting due to 4 previous errors
4657
0 commit comments