-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking Issue for item-level const blocks #149226
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).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-const_block_items`#![feature(const_block_items)]``#![feature(const_block_items)]`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).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-const_block_items`#![feature(const_block_items)]``#![feature(const_block_items)]`T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Exploration
There has been no RFC, afaict. However, t-lang have expressed enthusiasm about seeing this added.
The feature gate for the issue is
#![feature(const_block_items)].Currently, this feature allows you to write
constblocks as items in modules. So, it makes the following code possible:Which is equivalent to the current
stable's: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.
See also
const {}blocks, andconst { assert!(...) }lang-team#251Steps
rustfmtUnresolved Questions
const { ... }item is equivalent toconst _: () =, but what about statement-items (i.e. inside function body) or assoc items?const { ... }sometimes an item and sometimes an expression complicates our story about that.Other possibilities would be things likenobody was too enthusiastic about this approach: see Ability to omitconst _ = ...;to clarify that it's an item, but shorten the syntax (like one can omit-> ()on functions): ()on const item declarations #149738()const"_identifiers that are inserted during AST->HIR lowering ofconst { ... }toconst _: () = const { ... };const _declarations #147136)static { ... }instead ofconst { ... }?Implementation history
constblocks:constblocks as amoditem #149174: ()forconstitems: Ability to omit: ()on const item declarations #149738