diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/const-generics/const-param-type-depends-on-const-param.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/const-param-type-depends-on-const-param.rs b/src/test/ui/const-generics/const-param-type-depends-on-const-param.rs new file mode 100644 index 000000000..9d50f9a47 --- /dev/null +++ b/src/test/ui/const-generics/const-param-type-depends-on-const-param.rs @@ -0,0 +1,19 @@ +// revisions: full min + +#![cfg_attr(full, feature(adt_const_params))] +#![cfg_attr(full, allow(incomplete_features))] + +// Currently, const parameters cannot depend on other generic parameters, +// as our current implementation can't really support this. +// +// We may want to lift this restriction in the future. + +pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]); +//~^ ERROR: the type of const parameters must not depend on other generic parameters +//[min]~^^ ERROR `[u8; _]` is forbidden + +pub struct SelfDependent<const N: [u8; N]>; +//~^ ERROR: the type of const parameters must not depend on other generic parameters +//[min]~^^ ERROR `[u8; _]` is forbidden + +fn main() {} |