-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |