summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/condition-in-trait-const-arg.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/const-generics/condition-in-trait-const-arg.rs')
-rw-r--r--src/test/ui/const-generics/condition-in-trait-const-arg.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/condition-in-trait-const-arg.rs b/src/test/ui/const-generics/condition-in-trait-const-arg.rs
new file mode 100644
index 000000000..6f85237cf
--- /dev/null
+++ b/src/test/ui/const-generics/condition-in-trait-const-arg.rs
@@ -0,0 +1,14 @@
+// Checks that `impl Trait<{anon_const}> for Type` evaluates successfully.
+// run-pass
+// revisions: full min
+
+#![cfg_attr(full, feature(generic_const_exprs))]
+#![cfg_attr(full, allow(incomplete_features))]
+
+trait IsZeroTrait<const IS_ZERO: bool>{}
+
+impl IsZeroTrait<{0u8 == 0u8}> for () {}
+
+impl IsZeroTrait<true> for ((),) {}
+
+fn main() {}