Automatically document feature flag requirements on docs.rs by using the feature `doc_auto_cfg`
Thanks for the nice crate!
Since this is an unsolicited PR, I completely understand if it is not interesting.
This PR automatically documents all feature flag requirements on docs.rs. This way any future feature flag gated code does not have to worry about documenting what features it needs. It uses the idea discussed in this stackoverflow post.
The feature requires a nightly compiler, but by conditionally enabling it only on docs.rs the MSRV of the crate is unchanged (docs.rs always uses the nightly compiler).
The result should look like this:
and this:
To test it locally you can do
RUSTDOCFLAGS="--cfg docsrs"; cargo +nightly doc --all-features
on Linux, and
$env:RUSTDOCFLAGS="--cfg docsrs"
cargo +nightly doc --all-features
on Windows.
That looks very good but right now, with the slow speed of development, I don't want to use any unstable features.
Ah, I hadn't seen that! Very nice.
Makes sense to not merge. Should I delete the PR, or is it something for the future?