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

Can't re-export features of optional dependency #5023

Closed
Diggsey opened this issue Feb 8, 2018 · 1 comment
Closed

Can't re-export features of optional dependency #5023

Diggsey opened this issue Feb 8, 2018 · 1 comment

Comments

@Diggsey
Copy link
Contributor

Diggsey commented Feb 8, 2018

As far as I can tell, there's no way to re-export features of an optional dependency.

Take these crates:
rayon - only compiles on targets with threads
jpeg_decoder - has a default feature "rayon" to enable faster decoding where possible
image - has a default feature "jpeg" which enables the jpeg decoder

Now the first problem is that image has an unconditional dependency on rayon. This isn't great, but it should be possible to fix by re-exporting a "rayon" feature from image.

However this doesn't work, because the "rayon" feature would have to automatically include the "jpeg_decoder" dependency, even if the "jpeg" feature is not enabled.

There should be a way to enable a dependency or dependency feature based on an intersection of top-level features.

@alexcrichton
Copy link
Member

I believe this is a dupe of #3494, so closing in favor of that

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

2 participants