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

Reexporting features implicitly enables optional dependency #7521

Closed
alecmocatta opened this issue Oct 17, 2019 · 1 comment
Closed

Reexporting features implicitly enables optional dependency #7521

alecmocatta opened this issue Oct 17, 2019 · 1 comment
Labels
C-bug Category: bug

Comments

@alecmocatta
Copy link

Problem

cargo check --features foo implicitly enables optional dependency bar given this manifest:

[features]
foo = ["bar/foo"]

[dependencies]
bar = { version = "0.1", path = "bar", optional = true }

The behaviour I would expect is bar not being enabled unless it's also specified in the --features.

If feature foo did in fact depend on bar, that could be specified like foo = ["bar", "bar/foo"].

Notes

Output of cargo version:

cargo 1.40.0-nightly (a429e8c 2019-10-04)

@alecmocatta alecmocatta added the C-bug Category: bug label Oct 17, 2019
@ehuss
Copy link
Contributor

ehuss commented Oct 17, 2019

Thanks for the report! This seems to be a duplicate of #3494, so I'm going to close in favor of that.

@ehuss ehuss closed this as completed Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants