Presentation on Const Generics as of 1.50.0 stable and 1.52.0-nightly
Challenges
- Beware no, or misleading, documentation
- Nothing in Rust Book.
- RFC https://rust-lang.github.io/rfcs/2000-const-generics.html and various issues rust-lang/rust#68436 have tips or examples, but many are invalid!
- Syntax may seem arbitrary:
- Need
::<turbofish at some places, ordinary<elsewhere. - Need
{...}curly brackets around some const generic parameter values, not around others. - Some error messages feel like going in circles.
- Need