We have a Criterion benchmark suite in benches that needs documentation. However we could not find anywhere instructions to generate documentation from the source files in benches
. cargo doc
appears to generate documentation only for the src
directory.
What is the best practice to document benchmarks (inside the benchmark code)?
UPDATE: I discovered the --bench
option of cargo rustdoc
, and indeed
cargo rustdoc --features cli --bench sux
shows that cargo is trying to generate documentation for the files in benches/sux
. Unfortunately it does not recognize any of the dependencies therein, not even criterion
or sux
(the main crate). Any suggestion?