Description
openedon Sep 10, 2020
This is a tracking issue for complex generic expressions in constants which is still highly experimental.
The feature gate for the issue is #![feature(generic_const_exprs)]
.
On stable all const generic arguments must be either:
- A fully concrete expression using no generic parameters, e.g.
Foo<{ bar(1 + 2) }
- A bare usage of a const parameter, e.g.
Foo<{ N }>
This feature allows arbitrary usage of generic parameters in const generic arguments such that Foo<{ bar(N + 2) }>
is now legal.
Initial proposal: rust-lang/compiler-team#340
Design document: HackMD document
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Status
The design questions and implementation challenges are collected in the project-const-generics repository. The implementation is still far from ready but already available for experimentation.