-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking Issue for Generic Constant Arguments MVP #132980
Copy link
Copy link
Open
12 / 1812 of 18 issues completedOpen
12 / 1812 of 18 issues completed
Copy link
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-min_generic_const_args`#![feature(min_generic_const_args)]``#![feature(min_generic_const_args)]`PG-const-genericsProject group: Const genericsProject group: Const genericsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-min_generic_const_args`#![feature(min_generic_const_args)]``#![feature(min_generic_const_args)]`PG-const-genericsProject group: Const genericsProject group: Const genericsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This is a tracking issue for the prototype described in rust-lang/rust-project-goals#100. Background reading as to the design/justification for this feature.
The feature gate for the issue is
#![feature(min_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
ConstArgKind::Path(Represent type-level consts with new-and-improvedhir::ConstArg#125915)ConstArgKind::Pathfor all single-segment paths (UseConstArgKind::Pathfor all single-segment paths, not just params undermin_generic_const_args#131081)ConstArgKind::Pathfor all pathsConstArgKind::Path#135186ConstArgKind::Pathfor uses ofstaticpaths #132986adt_const_paramstypes:Adt { field: N }..restpatterns as direct const args? #150622Some(N)MGCA: support tuple constructor calls as a direct const argument #150610NoneSupportConstArgKind::Paths for const struct/variant constructors #132985[M; N],[1, 2, N]MGCA: Support array expressions as direct const arguments #150612(10, N)MGCA: Support tuple expressions as direct const arguments #150613#[type_const]#148716#[type_const]#148716type_consts tomir::Const::Tyso they can be normalized in the MIR correctly MGCA: uses of type_const items inside of bodies should lower tomir::Const::Ty#150615associated_const_equalitybounds mgca: Add ConstArg representation for const items #139558feature(associated_const_equality)intomin_generic_const_argsMGCA: mergeassociated_const_equalityfeature gate into MGCA #150617ConstArgKind::LiteralMGCA: Support literals as direct const arguments #150618ConstKind::ValueandValTreenow that they're not fully evaluated Followup work from makingValTreerecurse throughty::Const#150624ValTreewhich doesn't recurse throughty::Constlike how it used to be Followup work from makingValTreerecurse throughty::Const#150624Unresolved Questions
Implementation history
Implementation history
hir::ConstArg#125915ConstArgKind::Pathfor all single-segment paths, not just params undermin_generic_const_args#131081ConstArgKind::Path#135186#[type_const]#148716DefIds under mgca #150025destructure_const#150411forbid_genericfield fromRes::SelfTyAlias#150589associated_const_equalityfeature gate into MGCA #150640find_attrinstead ofattr::contains_nameinlower_const_item_rhs#151288generic_const_exprs#151275FeedConstTyand provide ty when lowering const arg #150962#[type_const]#152000tcx.is_type_const#152136type constsyntax instead of the#[type_const]attribute. #152324try_to_raw_byteswhen array elements have mismatched #152794const_lit_matches_tycheck literal suffixes for exact type match #152906DefKind::ConstandDefKind::AssocConstto have ais_type_constflag #153050Footnotes
Initial effort to implement which includes parsing and use of
termthroughout the codebase, but still lacking a complete implementation. ↩More thorough implementation which works for basic cases. This allowed for consts to actually be bound, more than just parsing them. ↩