about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-01-24 16:19:25 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-01-26 13:55:59 +0000
commit6f543d5cebe220595174a135eca92765df8c97e3 (patch)
treec901e4455c97cddfb3201e16cb7de4e69ea543c8
parentbc0170a43bd6e4f5beef12900d76a2aef89844af (diff)
downloadrust-6f543d5cebe220595174a135eca92765df8c97e3.tar.gz
rust-6f543d5cebe220595174a135eca92765df8c97e3.zip
Add regression test
-rw-r--r--tests/ui/parallel-rustc/cycle_crash.rs5
-rw-r--r--tests/ui/parallel-rustc/cycle_crash.stderr18
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/parallel-rustc/cycle_crash.rs b/tests/ui/parallel-rustc/cycle_crash.rs
new file mode 100644
index 00000000000..94ae11aef39
--- /dev/null
+++ b/tests/ui/parallel-rustc/cycle_crash.rs
@@ -0,0 +1,5 @@
+//@ compile-flags: -Z threads=2
+
+const FOO: usize = FOO; //~ERROR cycle detected when simplifying constant for the type system `FOO`
+
+fn main() {}
diff --git a/tests/ui/parallel-rustc/cycle_crash.stderr b/tests/ui/parallel-rustc/cycle_crash.stderr
new file mode 100644
index 00000000000..7af3b8ee532
--- /dev/null
+++ b/tests/ui/parallel-rustc/cycle_crash.stderr
@@ -0,0 +1,18 @@
+error[E0391]: cycle detected when simplifying constant for the type system `FOO`
+  --> $DIR/cycle_crash.rs:3:1
+   |
+LL | const FOO: usize = FOO;
+   | ^^^^^^^^^^^^^^^^
+   |
+note: ...which requires const-evaluating + checking `FOO`...
+  --> $DIR/cycle_crash.rs:3:20
+   |
+LL | const FOO: usize = FOO;
+   |                    ^^^
+   = note: ...which again requires simplifying constant for the type system `FOO`, completing the cycle
+   = note: cycle used when running analysis passes on this crate
+   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0391`.