-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow statics initializing themselves
- Loading branch information
Showing
3 changed files
with
37 additions
and
3 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
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
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,21 @@ | ||
error[E0391]: cycle detected when const-evaluating `FOO` | ||
--> $DIR/recursive-zst-static.rs:7:18 | ||
| | ||
LL | static FOO: () = FOO; | ||
| ^^^ | ||
| | ||
note: ...which requires const-evaluating `FOO`... | ||
--> $DIR/recursive-zst-static.rs:7:1 | ||
| | ||
LL | static FOO: () = FOO; | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
= note: ...which again requires const-evaluating `FOO`, completing the cycle | ||
note: cycle used when const-evaluating + checking `FOO` | ||
--> $DIR/recursive-zst-static.rs:7:1 | ||
| | ||
LL | static FOO: () = FOO; | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0391`. |