Tracking Issue for Generic Const Arguments
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
This is a tracking issue for generic const arguments (previously opaque_generic_const_args), an experimental feature that can support many of the same use cases as the current implementation of generic_const_exprs (#76560), but based on the machinery developed for min_generic_const_args (#132980). Unlike in GCE, GCA expressions are only allowed as the right-hand side of const items. Uses of these const items use "definitional equality" unless they are able to be evaluated by const eval.
The feature gate for the issue is #![feature(generic_const_args)].
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.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
- Implement the feature (#150823)
- Fix normalization for consts (needed to handle coherence properly for OGCA)
- Adjust documentation (see instructions on rustc-dev-guide)
- Style updates for any new syntax (nightly-style-procedure)
- Style team decision on new formatting
- Formatting for new syntax has been added to the Style Guide
- (non-blocking) Formatting has been implemented in
rustfmt
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
- How can we make sure to support opaque GCA while being forwards-compatible with more sophisticated equality support (e.g. commutativity in arithmetic)? This is especially tricky with regard to things like coherence.
- How do we avoid rough edges at the boundary of semantic/sophisticated equality vs opaque definitional equality?
Implementation history
- #150823
- #154710
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the remaining checklist, the rustc-dev-guide stabilization and documentation instructions, and the Style Guide and nightly-style procedure linked in the issue. Determine the documentation, style decision, formatting, and stabilization work still needed for generic_const_args; done means those checklist items are addressed and a stabilization PR is prepared.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100