about summary refs log tree commit diff
path: root/tests/incremental
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-04-29 11:01:08 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-05-17 20:28:42 +0000
commit222acaa23e2c0e09687b04e3243fad18f4909f30 (patch)
tree20212d88f00bf98bd9e5aec7027b7af1531ca665 /tests/incremental
parentad23942ad4079f779651983b262fa34c0beda701 (diff)
downloadrust-222acaa23e2c0e09687b04e3243fad18f4909f30.tar.gz
rust-222acaa23e2c0e09687b04e3243fad18f4909f30.zip
Add incremental test.
Diffstat (limited to 'tests/incremental')
-rw-r--r--tests/incremental/const-generic-type-cycle.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/incremental/const-generic-type-cycle.rs b/tests/incremental/const-generic-type-cycle.rs
new file mode 100644
index 00000000000..489420d009e
--- /dev/null
+++ b/tests/incremental/const-generic-type-cycle.rs
@@ -0,0 +1,16 @@
+// Verify that we do not ICE when we try to overwrite an anon-const's type because of a trait
+// cycle.
+//
+// compile-flags: -Zincremental-ignore-spans
+// revisions: cpass cfail
+
+#![feature(trait_alias)]
+#![crate_type="lib"]
+
+#[cfg(cpass)]
+trait Bar<const N: usize> {}
+
+#[cfg(cfail)]
+trait Bar<const N: dyn BB> {}
+
+trait BB = Bar<{ 2 + 1 }>;