summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/min_const_generics/complex-types.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/const-generics/min_const_generics/complex-types.rs')
-rw-r--r--tests/ui/const-generics/min_const_generics/complex-types.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/const-generics/min_const_generics/complex-types.rs b/tests/ui/const-generics/min_const_generics/complex-types.rs
new file mode 100644
index 000000000..057bd5af8
--- /dev/null
+++ b/tests/ui/const-generics/min_const_generics/complex-types.rs
@@ -0,0 +1,27 @@
+#![feature(never_type)]
+
+struct Foo<const N: [u8; 0]>;
+//~^ ERROR `[u8; 0]` is forbidden
+
+struct Bar<const N: ()>;
+//~^ ERROR `()` is forbidden
+#[derive(PartialEq, Eq)]
+struct No;
+
+struct Fez<const N: No>;
+//~^ ERROR `No` is forbidden
+
+struct Faz<const N: &'static u8>;
+//~^ ERROR `&'static u8` is forbidden
+
+struct Fiz<const N: !>;
+//~^ ERROR `!` is forbidden
+
+enum Goo<const N: ()> { A, B }
+//~^ ERROR `()` is forbidden
+
+union Boo<const N: ()> { a: () }
+//~^ ERROR `()` is forbidden
+
+
+fn main() {}