summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/generic_const_exprs/issue-73899.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/const-generics/generic_const_exprs/issue-73899.rs')
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-73899.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-73899.rs b/src/test/ui/const-generics/generic_const_exprs/issue-73899.rs
new file mode 100644
index 000000000..d1ab1be04
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-73899.rs
@@ -0,0 +1,20 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait Foo {}
+
+impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
+
+trait FooImpl<const IS_ZERO: bool> {}
+
+impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {}
+
+impl<const N: usize> FooImpl<{ 0u8 != 0u8 }> for [(); N] {}
+
+fn foo<T: Foo>(_v: T) {}
+
+fn main() {
+ foo([]);
+ foo([()]);
+}