Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sections about panics during constant evaluation
Since const panics are now [stabilized], I figure it would be good to document some of its gotchas. I couldn't really find documents for the specifics I ran into. I am no const eval expert, and what I wrote is basically a paraphrase of Ralf's comments[^1][^2], but I hope to get the ball rolling for adding some docs. I deliberately chose to not mention the guarantee about syntactically referenced constants in functions that require code generation as it seems hard to explain completely without some ambiguity. It also seems to me that the rules are not completely stable[^3][^4] yet. [stabilized]: rust-lang/rust#89006 [^1]: rust-lang/rust#91877 (comment) [^2]: rust-lang/rust#91877 (comment) [^3]: rust-lang/rust#71800 [^4]: rust-lang/rust#51999 (comment)
- Loading branch information