@@ -4,6 +4,12 @@ error[E0770]: the type of const parameters must not depend on other generic para
4
4
LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
5
5
| ^ const parameters must have a concrete type
6
6
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
+
7
13
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
8
14
--> $DIR/const-param-type-depends-on-const-param.rs:1:12
9
15
|
@@ -26,6 +32,19 @@ note: cycle used when computing type of `Dependent`
26
32
LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]);
27
33
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28
34
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
30
49
31
50
For more information about this error, try `rustc --explain E0391`.
0 commit comments