Tracking issue for cfg_select (formerly cfg_match) · Issue #115585 · rust-lang/rust (original) (raw)

Provides a native way to easily manage multiple conditional flags without having to rewrite each clause multiple times.

Public API

cfg_select! { unix => { fn foo() { /* unix specific functionality / } } target_pointer_width = "32" => { fn foo() { / non-unix, 32-bit functionality / } } _ => { fn foo() { / fallback implementation */ } } }

Steps / History

Unresolved Questions

References