pub macro cfg_select($($tt:tt)*) {
    ...
}🔬This is a nightly-only experimental API. (
cfg_select #115585)Expand description
Selects code at compile-time based on cfg predicates.
This macro evaluates, at compile-time, a series of cfg predicates,
selects the first that is true, and emits the code guarded by that
predicate. The code guarded by other predicates is not emitted.
An optional trailing _ wildcard can be used to specify a fallback. If
none of the predicates are true, a compile_error is emitted.
§Example
#![feature(cfg_select)]
cfg_select! {
    unix => {
        fn foo() { /* unix specific functionality */ }
    }
    target_pointer_width = "32" => {
        fn foo() { /* non-unix, 32-bit functionality */ }
    }
    _ => {
        fn foo() { /* fallback implementation */ }
    }
}The cfg_select! macro can also be used in expression position, with or without braces on the
right-hand side: