Cargo build for all or some specific features



I have two exclusive features A and B in my cargo that they pull different crates and I want to make a unified crate out of them so I was wondering how to include both when building a module common? do we have #[cfg(all(features))] or #[cfg(any(features = "A", features = "B"))] or something similar? I haven’t found anything yet though!


This is correct.


Thanks for the clarifications! but it doesn’t work and I cannot import the one with features “A” in one crate and “B” in another later!


Ah, nevermind! seems typo is allowed feature not features.