Skip to content

Commit 6f543d5

Browse files
committed
Add regression test
1 parent bc0170a commit 6f543d5

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ compile-flags: -Z threads=2
2+
3+
const FOO: usize = FOO; //~ERROR cycle detected when simplifying constant for the type system `FOO`
4+
5+
fn main() {}
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error[E0391]: cycle detected when simplifying constant for the type system `FOO`
2+
--> $DIR/cycle_crash.rs:3:1
3+
|
4+
LL | const FOO: usize = FOO;
5+
| ^^^^^^^^^^^^^^^^
6+
|
7+
note: ...which requires const-evaluating + checking `FOO`...
8+
--> $DIR/cycle_crash.rs:3:20
9+
|
10+
LL | const FOO: usize = FOO;
11+
| ^^^
12+
= note: ...which again requires simplifying constant for the type system `FOO`, completing the cycle
13+
= note: cycle used when running analysis passes on this crate
14+
= 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
15+
16+
error: aborting due to 1 previous error
17+
18+
For more information about this error, try `rustc --explain E0391`.

0 commit comments

Comments
 (0)