-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.
Description
It's quite often that a cfg directive in an attribute becomes fairy complicated when support for more platforms are added. Even worse, a cfg block is then often duplicated among many locations to configure off different items.
The thread_local/mod.rs file is a good example of the amount of duplication.
It would be nice to have something like the following
#![cfg_shortcut(foo, any(super, long, clause))]
#[cfg(foo)] ...
#[cfg(not(foo))] ...Here the clause any(super, long, clause) would be shortened to the identifier foo which could then be used elsewhere. In general it would just be nice to make these long cfg directives much shorter and less error prone to copy-paste.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.