Setting features for dev-dependencies in [features] causes crate to be unusable as dependency


So I have 3 crates with the following Cargo.toml files.

name = "some_tests"
version = "0.0.0"

default = [use-std]
use-std = []


name = "foo"
version = "0.0.0"

some_tests = {path = "../some_tests", default-features = false}

default = [use-std]
use-std = ["some_tests/use-std"]

And bar:

name = "bar"
version = "0.0.0"

foo = {path = "../foo", default-features = false}

default = [use-std]
use-std = ["foo/use-std"]

Rationale behind such structure is that I want to be able to disable some parts of test suit which are not compatible with no_std. foo gets compiled all right, but then I try to compile bar I get the following error:

error: Package `foo v0.0.0 (file:///path/to/foo)` does not have these features: `some_tests`

As I understand problem is that dev-dependencies do not propagate to higher level crates, so then I try to compile bar cargo can’t see some_tests dependency for foo thus failing to set necessary feature.

How can be this fixed or is there a better way of doing this?


This is


This issue was closed in favor of this issue:
Looks like last comment there mentions my problem:

Actually, it also shows up when:

  • The exact same dependency is used as both a dev and non-dev dependency.
  • The dependency does not specify any features.
  • The dev-dependency version says default-features=false.

It’s a shame, but it seems there is no solution for this issue in sight.