-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking issue for cfg_select (formerly cfg_match) #115585
Copy link
Copy link
Closed
Labels
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-cfg_select`#![feature(cfg_select)]``#![feature(cfg_select)]`I-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
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-cfg_select`#![feature(cfg_select)]``#![feature(cfg_select)]`I-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
View all comments
Provides a native way to easily manage multiple conditional flags without having to rewrite each clause multiple times.
Public API
Steps / History
cfg_match!macro #115416)cfg_matchtocfg_selectRenamecfg_match!tocfg_select!#137198cfg_select!#149783Unresolved Questions
What should the final syntax be? A match-like syntax feels more natural in the sense that each macro fragment resembles an arm.Should the macro be supported directly by a language feature?What should the feature name be?cfg_matchconflicts with the already existingcfg_matchcrate.How can we support usage in both expression-position and item position?Support trailing commas to have similar grammar as(cfg_select: Support unbraced expressions #145233)matchstatements.References
cfg_if#59442Implementation history
cfg_match(Compiler) #116312cfg_matchinto a builtin #116323cfg_match(Library) #116342cfg_matchfrom the prelude #117162cfg_match] Generalize inputs #130313cfg_match!tocfg_select!#137198cfg_match!a semitransparent macro #138993cfg_match!in core #138996cfg_selecta builtin macro #143461cfg_select!documentation #143941Tooling support
rustfmtside:cfg_select#144323