summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/issues/issue-85031-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/const-generics/issues/issue-85031-2.rs')
-rw-r--r--tests/ui/const-generics/issues/issue-85031-2.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/const-generics/issues/issue-85031-2.rs b/tests/ui/const-generics/issues/issue-85031-2.rs
new file mode 100644
index 000000000..50dd66da6
--- /dev/null
+++ b/tests/ui/const-generics/issues/issue-85031-2.rs
@@ -0,0 +1,17 @@
+// check-pass
+// known-bug: unknown
+
+// This should not compile, as the compiler should not know
+// `A - 0` is satisfied `?x - 0` if `?x` is inferred to `A`.
+#![allow(incomplete_features)]
+#![feature(generic_const_exprs)]
+
+pub struct Ref<'a>(&'a i32);
+
+impl<'a> Ref<'a> {
+ pub fn foo<const A: usize>() -> [(); A - 0] {
+ Self::foo()
+ }
+}
+
+fn main() {}