diff options
| -rw-r--r-- | src/test/ui/const-generics/const-param-type-depends-on-type-param.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/const-generics/const-param-type-depends-on-type-param.stderr | 21 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/const-param-type-depends-on-type-param.rs b/src/test/ui/const-generics/const-param-type-depends-on-type-param.rs new file mode 100644 index 00000000000..06ee523be48 --- /dev/null +++ b/src/test/ui/const-generics/const-param-type-depends-on-type-param.rs @@ -0,0 +1,7 @@ +#![feature(const_generics)] +//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash + +pub struct Dependent<T, const X: T>([(); X]); //~ ERROR const parameters +//~^ ERROR const generics in any position are currently unsupported + +fn main() {} diff --git a/src/test/ui/const-generics/const-param-type-depends-on-type-param.stderr b/src/test/ui/const-generics/const-param-type-depends-on-type-param.stderr new file mode 100644 index 00000000000..375c9fa5321 --- /dev/null +++ b/src/test/ui/const-generics/const-param-type-depends-on-type-param.stderr @@ -0,0 +1,21 @@ +warning: the feature `const_generics` is incomplete and may cause the compiler to crash + --> $DIR/const-param-type-depends-on-type-param.rs:1:12 + | +LL | #![feature(const_generics)] + | ^^^^^^^^^^^^^^ + +error[E0670]: const parameters cannot depend on type parameters + --> $DIR/const-param-type-depends-on-type-param.rs:4:34 + | +LL | pub struct Dependent<T, const X: T>([(); X]); //~ ERROR const parameters + | ^ const parameter depends on type parameter + +error: const generics in any position are currently unsupported + --> $DIR/const-param-type-depends-on-type-param.rs:4:31 + | +LL | pub struct Dependent<T, const X: T>([(); X]); //~ ERROR const parameters + | ^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0670`. |
