3

I'm using Cargo features for conditional compilation of some things in a library.

As I'm documenting the library, I noticed that the Cargo features appear nowhere in the generated documentation. When I generated the docs with cargo doc --all-features, I expected to see some kind of label telling the user that struct X is available only with feature Y is enabled.

Writing this information on each item manually seems to be very error-prone, so is there a way to generate such a thing automatically?

rodrigocfd
  • 6,450
  • 6
  • 34
  • 68

0 Answers0