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

Cargo book should explain that features must be additive #8458

Closed
jimblandy opened this issue Jul 6, 2020 · 3 comments
Closed

Cargo book should explain that features must be additive #8458

jimblandy opened this issue Jul 6, 2020 · 3 comments
Labels
C-bug Category: bug

Comments

@jimblandy
Copy link

Cargo features must be additive, because if two crates agree on the version of a common dependency, but want different features from it, that dependency is built only once, with the union of the features requested. So if a crate can meet a dependent's expectations with a given set of features enabled, it must still meet those expectations if additional features are enabled.

This is a pretty fundamental restriction on how you can use features, but the Cargo book doesn't mention it in the section on features. It would be a natural fit in the 'Rules' section.

@jimblandy jimblandy added the C-bug Category: bug label Jul 6, 2020
@jimblandy jimblandy changed the title Cargo book should explain why features must be additive Cargo book should explain that features must be additive Jul 6, 2020
@Eh2406
Copy link
Contributor

Eh2406 commented Jul 6, 2020

That is an important restriction on features, Yes. If there is a good place to add it to docs I'd be open to seeing a PR.

Thank you!

@ehuss
Copy link
Contributor

ehuss commented Jul 7, 2020

Thanks for the report! This is a duplicate of #4328, so closing in favor of that.

@ehuss ehuss closed this as completed Jul 7, 2020
@jimblandy
Copy link
Author

@ehuss D'oh, thanks. I did search, but I guess I didn't find the magic set of terms...

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

3 participants