mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
594a848f49
docs(unstable-book): Document const generics features Relevant tracking issues: rust-lang/rust#113521 rust-lang/rust#132980 rust-lang/rust#76560 rust-lang/rust#151972 ## What Adds a high-level overview of 4 unstable features related to const generic exprs. ## Why While trying to learn about the current state of const generic exprs, I found it a bit too hard due to lack of documentation -- had to read through a bunch of tracking issues & look for PRs/examples in the repo just to understand what the feature is about. Moreover, given that there is a bunch of features with similarly-looking names, it was even more confusing. For that purpose, I also added cross-referencing across (directly or logically) related features. As a result, I decided to add some more context to the unstable book, so that new readers have an easier time than I had. ## Caveats I understand that the features are incomplete/experimental, so the docs are at risk of becoming stale, but the book entrypoint already has [a corresponding warning](https://doc.rust-lang.org/unstable-book/), so I guess it should be fine. Also, given that I did research myself, the examples provided might be not the best to showcase the feature -- happy to provide better examples, if you have suggestions. The examples provided are what "made the feature make sense" to me as an outsider, so there is a chance that they will be good for other external readers too, though. LLM use disclosue: an LLM was used for self-review only; research, coming up with examples, and writing is mine. Issues reported by LLM were fixed manually too. r? @BoxyUwU