I'm hit by cargo wanting to take the union of feature flags in the dependency tree across dependencies and dev-dependencies. This seems to be a four year old issue, so it doesn't look like it will be resolved soon. This means I need to work around it somehow.
The problem is concretely:
[dependencies]
itertools = { version = "0.8.0", default_features = false }
[dev-dependencies]
criterion = "0.2.10"
I need itertools to be build without the std feature, but criterion depends on itertools with default features, which includes std. cargo build --lib will thus build itertools with std, despite me explicitly disabling it and a --lib build not requiring dev-dependencies.
How to best work around this?