-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking issue for generic const items #113521
Copy link
Copy link
Open
Labels
B-experimentalBlocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).Blocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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-generic_const_items`#![feature(generic_const_items)]``#![feature(generic_const_items)]`S-tracking-needs-to-bakeStatus: The implementation is "complete" but it needs time to bake.Status: The implementation is "complete" but it needs time to bake.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
B-experimentalBlocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).Blocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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-generic_const_items`#![feature(generic_const_items)]``#![feature(generic_const_items)]`S-tracking-needs-to-bakeStatus: The implementation is "complete" but it needs time to bake.Status: The implementation is "complete" but it needs time to bake.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Fixed By
Status
Exploration
This is a tracking issue for the experimental feature generic const items (RFC pending).
The feature gate for the issue is
#![feature(generic_const_items)].It enables generic parameters and where-clauses on free and associated const items.
See also rust-lang/lang-team#214.
About experimental features
An experimental feature is one that has not yet had an RFC. The idea is to allow implementation work to proceed to better inform an upcoming RFC. Experimental features cannot be stabilized without first having an RFC. The existence of an experimental feature does not indicate lang team consensus that the feature is desirable, only that there is a problem that is worthy of being solved and that the idea has enough merit to consider exploring. See the lang team process page for more details.
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.
Steps
Experimental results
Part of the goal of the experimental process is to identify benefits but also concerns that need to be addressed in the RFC. This section catalogues notable findings thus far.
where Self: 'a” bounds on GACs like we do on GATs (GATs: Decide whether to have defaults forwhere Self: 'a#87479)?Unresolved, not implemented.
#![feature(trivial_bounds)] const _UNUSED: () = () where String: Copy;successfully compile?Ideally yes, not implemented.I was about to impl that in GCI: Don't evaluate the initializer of free const items that have trivially unsatisfied predicates #142293 but it was found out that it has bad SemVer implications, see GCI: Don't evaluate the initializer of free const items that have trivially unsatisfied predicates #142293 (comment).
const _<T>: () = ();)?Unresolved, not implemented.
&'a &'b ()inconst K<'a, 'b>: &'a &'b () = &&();imply the bound'b: 'a(similarly,const K<'a, T>: &'a T = loop {};andT: 'a)?Probably yes, WIP impl in GCI: Imply outlives-bounds on free (generic) const items #143029
Implementation history
const Trait(always-const trait bounds) #119099Footnotes
Generic associated constants, i.e., associated constants with generics and/or a where clause. ↩