Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior with features of a dev-dependency #120

Closed
cmichi opened this issue Aug 2, 2021 · 1 comment
Closed

Strange behavior with features of a dev-dependency #120

cmichi opened this issue Aug 2, 2021 · 1 comment

Comments

@cmichi
Copy link

cmichi commented Aug 2, 2021

I've ran into same strange behavior and can't figure out if this is a bug in trybuild or if I'm overlooking something:

If I have a Cargo.toml of a crate mycrate containing this:

[dev-dependencies]
trybuild = "1.0.43"
somecrate = { path = "../somecrate/" }

[features]
somefeature = ["somecrate/foobar"]

I get this error when running cargo test (without any features enabled!):

the package `mycrate-tests` depends on `mycrate`, with features: `somecrate` but `mycrate` does not have these features.

It works if I either remove the features section or move the somecrate dependency to [dependencies].

Any thoughts?

@cmichi
Copy link
Author

cmichi commented Aug 3, 2021

Found rust-lang/cargo#6915, which was created by yours truly @dtolnay 🙈.

The issue is that features for dev-dependencies currently cannot be enabled by parent crates.

@cmichi cmichi closed this as completed Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant