summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/generic_const_exprs/less_than.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/const-generics/generic_const_exprs/less_than.rs')
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/less_than.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/generic_const_exprs/less_than.rs b/src/test/ui/const-generics/generic_const_exprs/less_than.rs
new file mode 100644
index 000000000..2e9af1bf4
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/less_than.rs
@@ -0,0 +1,14 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+struct Foo<const B: bool>;
+
+fn test<const N: usize>() -> Foo<{ N > 10 }> where Foo<{ N > 10 }>: Sized {
+ Foo
+}
+
+fn main() {
+ let _: Foo<true> = test::<12>();
+ let _: Foo<false> = test::<9>();
+}