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

Mutually exclusive features support #7924

Closed
GopherJ opened this issue Feb 24, 2020 · 1 comment
Closed

Mutually exclusive features support #7924

GopherJ opened this issue Feb 24, 2020 · 1 comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@GopherJ
Copy link

GopherJ commented Feb 24, 2020

Describe the problem you are trying to solve

Say that we would like to develop a crate which has two features mutually exclusive:

  • runtime-tokio
  • runtime-async-std

I would like to keep the same api, in this case if I run:

cargo test --all-features

it will show duplicated elements.

I think what's missing here is the notion of mutually exclusive features, if we can say two features are mutually exclusive, it will be able to solve the problem because we can then let cargo to run them one by one.

For example, we would like to design a crate with features: a, b, c, d, a and b are mutually exclusive.

Then cargo test --all-features should run two times:

cargo test  --no-default-features --features a,c,d
cargo test  --no-default-features --features b,c,d

Describe the solution you'd like

Notes

@GopherJ GopherJ added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Feb 24, 2020
@GopherJ GopherJ changed the title Mutually exclusive features Mutually exclusive features support Feb 24, 2020
@ehuss
Copy link
Contributor

ehuss commented Feb 24, 2020

Thanks for the report. This appears to be essentially a duplicate of #2980, so I'm going to close in favor of that.

@ehuss ehuss closed this as completed Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

2 participants