Skip to content

Tracking Issue for complex generic constants: feature(generic_const_exprs) #76560

Open

Description

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)C-tracking-issueCategory: A tracking issue for an RFC or an unstable feature.F-generic_const_exprs`#![feature(generic_const_exprs)]`S-tracking-impl-incompleteStatus: The implementation is incomplete.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions