crates.io
cfg-if
A macro to ergonomically define an item depending on a large number of #[cfg] parameters. Structured like an if-else chain, the first matching branch is the item that gets emitted.
v1.0.4View on crates.io ↗
Security
No known vulnerabilities in the OSV database as of the last sync.
Repository
https://github.com/rust-lang/cfg-if ↗Sourced from crates.io · Updated September 6, 2026
Package metadata from crates.io, the Rust community's crate registry.
View original source ↗Spot an error on this page? Let us know →FAQ
Common questions
What is cfg-if?
A macro to ergonomically define an item depending on a large number of #[cfg] parameters. Structured like an if-else chain, the first matching branch is the item that gets emitted.
Is cfg-if safe to use?
No known vulnerabilities in the OSV database as of the last sync.
What license does cfg-if use?
cfg-if does not specify a license.