Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Jan 24, 2025
1 parent bc0170a commit 9e783e2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/ui/parallel-rustc/cycle_crash.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//@ compile-flags: -Z threads=2
//@ check-fail

const FOO: usize = FOO; //~ERROR `main` function not found in crate `cycle_crash
//~^ cycle detected when simplifying constant for the type system `FOO`
25 changes: 25 additions & 0 deletions tests/ui/parallel-rustc/cycle_crash.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
error[E0601]: `main` function not found in crate `cycle_crash`
--> $DIR/cycle_crash.rs:4:24
|
LL | const FOO: usize = FOO;
| ^ consider adding a `main` function to `$DIR/cycle_crash.rs`

error[E0391]: cycle detected when simplifying constant for the type system `FOO`
--> $DIR/cycle_crash.rs:4:1
|
LL | const FOO: usize = FOO;
| ^^^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `FOO`...
--> $DIR/cycle_crash.rs:4: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 2 previous errors

Some errors have detailed explanations: E0391, E0601.
For more information about an error, try `rustc --explain E0391`.

0 comments on commit 9e783e2

Please sign in to comment.