#Finding out which dependency enabled a crate feature?

4 messages · Page 1 of 1 (latest)

placid fox
#

Hi all. I found myself in this annoying situation in which a feature of a dependency of my project has been indirectly enabled, but I don't want it enabled.

What I mean is, say my project has got dependencies A B and C, where both B and C also depend on A.
A has a feature A/foo, and I want to disable this feature. However IIRC the enabled features of A is the superset of all features of A declared by my project, B, and C. Since I haven't enabled A/foo, this means either B or C has enabled it.
So the question is, is there a quick way to find out which dependency (B or C in this example, but in reality I've got like 20 direct dependencies) has caused A/foo to be enabled?

neat silo
#

how about cargo tree -i A -e features

placid fox
#

Oh yeah bingo.

#

Awesome. This is exactly what I want. Thanks so much.