From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../const-param-type-depends-on-const-param.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/ui/const-generics/const-param-type-depends-on-const-param.rs (limited to 'tests/ui/const-generics/const-param-type-depends-on-const-param.rs') diff --git a/tests/ui/const-generics/const-param-type-depends-on-const-param.rs b/tests/ui/const-generics/const-param-type-depends-on-const-param.rs new file mode 100644 index 000000000..64b2acb03 --- /dev/null +++ b/tests/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([(); N]); +//~^ ERROR: the type of const parameters must not depend on other generic parameters +//[min]~^^ ERROR `[u8; N]` is forbidden + +pub struct SelfDependent; +//~^ ERROR: the type of const parameters must not depend on other generic parameters +//[min]~^^ ERROR `[u8; N]` is forbidden + +fn main() {} -- cgit v1.2.3