@@ -4,6 +4,12 @@ error[E0770]: the type of const parameters must not depend on other generic para
44LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
55 | ^ const parameters must have a concrete type
66
7+ error[E0769]: the type of const parameters must not depend on other generic parameters
8+ --> $DIR/const-param-type-depends-on-const-param.rs:13:40
9+ |
10+ LL | pub struct SelfDependent<const N: [u8; N]>;
11+ | ^ const parameters must have a concrete type
12+
713warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
814 --> $DIR/const-param-type-depends-on-const-param.rs:1:12
915 |
@@ -26,6 +32,19 @@ note: cycle used when computing type of `Dependent`
2632LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
2733 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2834
29- error: aborting due to 2 previous errors; 1 warning emitted
35+ error[E0391]: cycle detected when computing type of `SelfDependent::N`
36+ --> $DIR/const-param-type-depends-on-const-param.rs:13:32
37+ |
38+ LL | pub struct SelfDependent<const N: [u8; N]>;
39+ | ^
40+ |
41+ = note: ...which again requires computing type of `SelfDependent::N`, completing the cycle
42+ note: cycle used when computing type of `SelfDependent`
43+ --> $DIR/const-param-type-depends-on-const-param.rs:13:1
44+ |
45+ LL | pub struct SelfDependent<const N: [u8; N]>;
46+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47+
48+ error: aborting due to 4 previous errors; 1 warning emitted
3049
3150For more information about this error, try `rustc --explain E0391`.
0 commit comments